MIST 4630 Final
If a prepared statement preparedStatement is a SQL Insert statement, you execute the statement using _________. - preparedStatement.executeUpdate(); - preparedStatement.execute(); - preparedStatement.query(); - preparedStatement.executeQuery();
(A) preparedStatement.executeUpdate();
A database URL for a MySQL database named test on host panda.armstrong.edu is ________. - jdbc.mysql.//panda.armstrong.edu/test - jdbc.mysql:///panda.armstrong.edu/test - jdbc:mysql://panda.armstrong.edu/test - jdbc:mysql:/panda.armstrong.edu/test
(C) jdbc:mysql://panda.armstrong.edu/test
Which of the following application components are generally provided by Platform-as-a-Service (PaaS)? (Select all that apply) - Servers and storage -Networking components - Hosted applications - Development tools, DBMS, business analytics - Operating systems - Data Center
- Servers and storage -Networking components - Development tools, DBMS, business analytics - Operating systems - Data Center (ALL BUT HOSTED APPLICATIONS)
Which of the following delimiters in a JSP file signals to the server that some Java code is included in the file? <%...%> <...> <!-- ... --> </.../>
<%...%>
Which of the following delimiters in a JSP file signals to the server that that a Java expression will be printed to the response object? </.../> <!-- ... --> <%= ... %> <% ... %>
<%= ... %>
Which of the following is a correct format for a hyperlink to the Terry College web site? - <a url="http://www.terry.uga.edu">The Terry College of Business</a> - <a>The Terry College of Business</a> - <a href="http://www.terry.uga.edu">The Terry College of Business</a> - <a>http://www.terry.uga.edu</a>
<a href="http://www.terry.uga.edu">The Terry College of Business</a>
Which of the following HTML tags makes text content a heading with the largest size?
<h1>
Which of the following is the correct HTML for inserting an image? - <img src="image.gif" alt="MyImage"> - <img href="image.gif" alt="MyImage"> - <image src="image.gif" alt="MyImage"> - <img alt="MyImage">image.gif</img>
<img src="image.gif" alt="MyImage">
Which of the following HTML tags will create a button that when clicked will cause the action of a form to be implemented? - <input type="button" name="submit" value="Go" /> - <input type="reset" name="submit" value="Go" /> - <input type="submit" name="submit" value="Go" /> - <submit name="submit" value="Go" />
<input type="submit" name="submit" value="Go" />
Which of the following HTML tags is correct for making a textbox that is named "age"? - <text name="age" /> - <text type="input" name="age" /> - <input type="name" text="age" /> - <input type="text" name="age" />
<input type="text" name="age" />
Which of the following is a correct tag for connecting an HTML page to an external style sheet? - <stylesheet>styles.css</stylesheet> - <style type="text/css" href="styles.css"> - <link rel="stylesheet" type="text/css" href="styles.css">
<link rel="stylesheet" type="text/css" href="styles.css">
Which of the following HTML tags would be used to create a drop-down list? - <input type="dropdown" /> - <select>...</select> - <input type="list"> - <list>...</list>
<select>...</select>
Which of the following HTML tags would be used to define a bulleted list? - <ol> - <ul> - <bl> - <list>
<ul>
Which of the following is a valid URL mapping annotation that appears in a servlet? - @annotation(urlPatterns = { "/guess" }) - @WebServlet(urlPatterns = { "/guess" }) - doPost(urlPattern) -doGet(urlPattern)
@WebServlet(urlPatterns = { "/guess" })
Assume that you have the following statement: PreparedStatement ps = connection.prepareStatement("select firstName, mi, lastName from Student where firstName = ? and lastName = ?"; To set a value John to the first parameter, use _________. - preparedStatement.setString(0, "John"); - preparedStatement.setString(1, "John""); - ps.setString(1, "John"); - ps.setString(0, "John");
(C) ps.setString(1, "John");
What does HTML stand for?
Hypertext Markup Language
A complete development and deployment environment in the cloud is known as ________. (fill in the blank)
PaaS
Which of the following is true about PaaS? - PaaS tools are often less sophisticated than with IaaS. - PaaS can make it easier to develop for multiple platforms. - Coding time for PaaS often takes longer. - Focusses only on the development portion of web applications.
PaaS can make it easier to develop for multiple platforms.
In a relational data model, ________ provides the means for accessing and manipulating data. - Language - Structure - SQL - Integrity
SQL
Suppose that a user enters the value 21 into a textbox called age. This value is sent along with the request to a JSP file. When the value is retrieved using the request.getParameter("age") method, what is the default data type for this method? - text - int - String - request
String
Which of the following is the correct CSS syntax for setting the background of the page black? - {body: background-color = black;} - body { background-color: black;} - body: color = black; - {body; color: black;}
body { background-color: black;}
Which of the following CSS statements will display a border with the following characteristics: The top border = 10 pixelsThe bottom border = 5 pixelsThe left border = 20 pixelsThe right border = 1pixel?
border-width: 10px 1px 5px 20px;
When adding a servlet to an Eclipse Dynamic Web Project, where is the best place to store the servlet within the project? - directly in the src/java folder - a package in the src/webapp folder - a package in the src/java folder - Java Libraries
a package in the src/java folder
Which of the following are considered to be benefits of using EC2? (SELECT ALL THAT APPLY) - ELASTIC WEB-SCALE COMPUTING - FLEXIBLE CLOUD HOSTING SERVICES - INTEGRATED - SECURE
all
Which of the following is considered to be an advantage that is derived from the use standardizing the use of web technologies? (Check all that apply) - MAKING THE WEB A MORE ACCESSIBLE PLACE - HELPING MAINTAIN BETTER SEO (SEARCH ENGINE OPTIMIZATION) - HELPING MAKE SOURCE CODE SIMPLER; REDUCING DEVELOPMENT AND MAINTENANCE TIME - ALLOWING FOR BACKWARD COMPATIBILITY AND VALIDATION - KEEPING THE WEB FREE AND ACCESSIBLE TO ALL
all of the above
What is the return value from: preparedStatement.executeUpdate("insert into T values (100, 'Smith')") - void - an int value indicating how many rows are effected from the method invocation - a value indicating whether the SQL statement has been executed successfully - an object that contains the status of the execution
an int value indicating how many rows are effected from the method invocation
An Elastic Beanstalk ________ is a logical collection of Elastic Beanstalk components, including environments, versions, and environment configurations. conceptually similar to a folder. (fill in the blank)
application
Which of the following CSS will add a background color for all <h1> elements? - h1 {background-color:#FFFFFF;} - h1#all {background-color:#FFFFFF;} - all.h1 {background-color:#FFFFFF;} - h1.all {background-color:#FFFFFF;}
h1 {background-color:#FFFFFF;}
Which of the following statements can be used to connect to a local MySQL database named test? - Connection connection = DriverManager.connect("jdbc:mysql://localhost/test", uname, pwd); - Connection connection = Request.getConnection("mysql:jdbc://localhost/test", uname, pwd); - Connection connection = DriverManager.getConnection(jdbc:mysql://localhost/test, uname, pwd); - Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test", uname, pwd);
(D) Connection connection = DriverManager.getConnection("jdbc:mysql://localhost/test", uname, pwd);
Which of the below tasks are required when deploying any basic dynamic web application (i.e. the Amortization app) developed using the technologies that we used in MIST4630 to an EC2 instance? (SELECT ALL THAT APPLY) - Exporting the project from Eclipse into a set of private/public keys - Installing Tomcat on the Beanstalk instance - Setting up the S3 instance - Creating a connection between the Lambda function and S3 - Setting up the Beanstalk instance - Installing JDK on the EC2 instance - Setting up the RDS instance
- Installing JDK on the EC2 instance
After you set up an EC2 instance, you can access and manage it in which of the following ways? (SELECT ALL THAT APPLY) - Programmatically via an API - Using remote viewing (RV) - Using the AWS Console - Using commands from your computer terminal
- Programmatically via an API - Using the AWS Console - Using commands from your computer terminal
Which of the following is an advantage of using separation of concerns when creating web applications? (Check all that apply) - maintainability - extensibility - reusability - optimizationality
- maintainability - extensibility - reusability
Which of the following is a possible value to using the CSS position attribute to style an HTML element? (select all that apply) - float - right - left - relative - absolute - fixed
- relative - absolute - fixed
In the doGet method of a servlet, we have constructed our results, and stored those in a resultsToBeDisplayed variable of type String. Now, we want to load this variable to the request object to be able to access it in our view component files. Which of the following are valid ways of doing so. (SELECT ALL THAT APPLY) - request.setAttribute("results", - resultsToBeDisplayed) - request.setParameter("results", resultsToBeDisplayed ) - request.setAttribute("results", "resultsToBeDisplayed") - request.setAttribute(results, "resultsToBeDisplayed") - request.setParameter(results, "resultsToBeDisplayed") - request.setParameter("results", "resultsToBeDisplayed")
-request.setAttribute("results", - resultsToBeDisplayed)
Which of the following CSS selectors can be used to select all elements with the class "intro"? - #intro {...} - .intro {...} - class intro {...} - * {...}
.intro {...}
In order from inside to the outside, what are the components of the CSS box model? (padding, content, border, margin)
1. content 2. padding 3. border 4. margin
When setting up an EC2 instance, you must specify a template that contains a software configuration for your instance. Which of the following is the AWS name for such a template: - Automated Machine Template (AMT) - Amazon Compute Design Controller (ACDC) - Amazon Processor Plan (APP) - Amazon Machine Image (AMI)
Amazon Machine Image (AMI)
What does CSS stand for?
Cascading Style Sheets
With the MVC design pattern, which of the following server side separation of concerns will be generally implemented using JSPs? - Create the appropriate response to send to the client. - Modeling our business components - Handle client-side behavior. - Receive a request and control which components act on the request.
Create the appropriate response to send to the client.
The core AWS compute service that lets you rent virtual computers on which to run their own computer applications is known as ___________________. - Elastic Compute Cloud (EC2) - Simple Storage Solution (S3) - Computer Processing Rental (CPR) - Flexible Tenant Processor (ftp)
Elastic Compute Cloud (EC2)
T/F: An HTTP get message can carry a larger amount of data than an HTTP post message.
FALSE
T/F: Only Java web applications can be hosted in an Elastic Beanstalk environment.
FALSE
T/F: The request and response objects need to be declared before we can use them within our JSP code.
FALSE
T/F: The request and response objects persist as long as the user continues to send requests to the server side application.
FALSE
T/F: The request.getParameter() method will return the data type Object.
FALSE
T/F: When Dynamic Applications are made using the MVC design model, Java classes in the model are usually assigned a unique url mapping.
FALSE
T/F: The following HTML tags will create a table with 3 rows of two columns each. <table> <tr> <td> a </td> <td> b </td> </tr> <tr> <td> c </td> <td> d </td> </tr> </table>
FALSE (only 2 rows)
T/F: In general, separation of concerns allows us to obtain high coupling and low cohesion.
FALSE (other way around)
A request object exists: - Only in the server-side - Only in the client-side - In both server-side and client-side - Only in the controller classes
Only in the server-side
Where in an HTML document is the correct place to refer to an external style sheet?
In the <head> section
JDBC stands for __________________. - Java Database Connectivity - Java Database Code - Java Data Backup Connector - Java Data Browser Code
Java Database Connectivity
With the MVC design pattern, which of the following server side separation of concerns will be generally implemented using plain old java objects (POJOs)? - Create the appropriate response to send to the client. - Receive a request and control which components act on the request. - Modeling our business components - Handle client-side behavior.
Modeling our business components
A HTTP response message is: - Created by the controller and takes the data from the server-side to the client-side. - Created by the webserver and takes the results from the controller to the view component. - Created by the server-side and takes the results back to the browser. - Created by the browser and takes user input to the server-side. - None of the above.
None of the above
With the MVC design pattern, which of the following server side separation of concerns will be generally implemented using Java Servlets? - Handle client-side behavior. - Create the appropriate response to send to the client. - Receive a request and control which components act on the request. - Modeling our business components
Receive a request and control which components act on the request.
Which of the following are created when the Web Server receives a request to hold any data that is sent from the client? - Response Object - Request Object - Data Object - Session Object
Request Object
Which of the following are created when the Web Server receives a request to hold the results that are to be sent back to the client? - Response Object - Session Object - Data Object - Request Object
Response Object
Which of the following Java statements can be used to retrieve the data submitted by the textbox on this form as a String? <form name="guessForm" action="guess" method="get" > <label> First Name: </label> <input type="text" name="fName" value="" /><br /> <input type="submit" name="guessButton" value="Go" /></form> - String fName = request.getParameter("text"); - String fName = request.getString("fName"); - String fName = request.getString("text"); - String fName = request.getParameter("fName");
String fName = request.getParameter("fName");
T/F: Amazon EC2 is integrated with most AWS services such as Amazon Simple Storage Service (Amazon S3), Amazon Relational Database Service (Amazon RDS), and Amazon Virtual Private Cloud (Amazon VPC).
TRUE
T/F: Deploying a web project to the Cloud using Elastic Beanstalk requires much less work than configuring and deploying directly to an EC2 instance.
TRUE
T/F: For our purposes, Apache Tomcat serves as the Web Server component for testing our applications, locally.
TRUE
T/F: The Elastic Beanstalk service is an example of Platform-as-a-Service (PaaS).
TRUE
T/F: The request and response objects are available to the doGet() and doPost() methods because they are passed as parameters for these methods by the Web server.
TRUE
T/F: When setting up an EC2 instance you should select the region. A region is a geographic area that contains one or more data centers with the hardware where your instance will "live."
TRUE
T/F: With the MVC design pattern, it is possible to include multiple JSPs to provide different view options.
TRUE
T/F:Data that is sent from the client to the server are stored on the request object as parameters
TRUE
What is the name of the organization that develops the primary web standards of HTML and CSS? - The World Wide Consortium (W3C) - Google - Defense Advanced Research Project (DARPA) - CERN
The World Wide Consortium (W3C)
Given the following code: PreparedStatement ps = connection.prepareStatement("select firstName, mi, lastName from Student where lastName = ?";ps.setString(1, "Smith");ResultSet resultSet = ps.executeQuery();System.out.println(resultSet.getString(1)); What would be the result? - The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set. - If the SQL SELECT statement returns no result, resultSet is null. - resultSet.getString(1) returns the mi field in the result set. - resultSet.getString(1) returns the firstName field in the result set.
The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set.
Which of the following is a true statement about the MVC design pattern? - The controller component is responsible for creating and formatting the response message. - The request and response objects are only directly available to Java classes in the model. - The view component is responsible for creating and formatting the response message. - The view component is responsible for receiving and handling the request message.
The view component is responsible for creating and formatting the response message.
When setting up a servlet, we need to create a ___________ to the servlet that will be used to set up any hyperlinks or form actions so that they will send a request for the servlet. - action submission - hyperlink - URL mapping - method
URL mapping
Which of the following Java commands will declare and instance of a Java model class called User when included within a JSP or servlet file? - user == instanceOf User - <%@ page import="model.User" %> - <%= user.declare() %> - User user = new User();
User user = new User();
Considering the below code and Student table in the database, what will be the returned [value, type] after running the ps.executeUpdate() instruction? Code: PreparedStatement ps = connection.prepareStatement("update Students set CanAttend = 'Yes' where Age > 21);ResultSet resultSet;ps.executeUpdate(); Student table: ID Name Age CanAttend 1 John 18 Yes 2 Juan 19 Yes 3 Ying 21 Yes 4 John 22 No CHOICES: - None of the above - [1,String] - [4,ReultsSet] - [4,String] - [1,ReultsSet] - [4,Integer] - [1,Integer]
[1,Integer]
A __________ is a stand-alone, software component that enables a Java application to interact with a database. - DB ECU - database driver - JDBC - RDS
database driver
Question 19 (1 point) What is the name of the servlet method that will execute when the following html form is received? <form name="guessForm" action="guess" method="get" > <label> First Name: </label> <input type="text" name="fName" value="" /> <input type="submit" name="guessButton" value="Go" /></form> - doGet() - doPost() - setName() - submit()
doGet()
What is the name of the servlet method that will execute when the following html form is received? <form name="guessForm" action="guess" method="post" > <label> First Name: </label> <input type="text" name="fName" value="" /> <input type="submit" name="guessButton" value="Go" /></form> - doPost() - setName() - submit() - doGet()
doPost()
With AWS Elastic Beanstalk, an ________ is a collection of AWS resources running an application version. (fill in the blank)
environment
The _______ designates the type of application that the environment runs, and determines what resources Elastic Beanstalk provisions to support it. (fill in the blank)
environment tier
When you launch an Elastic Beanstalk environment, the _________________ designates the type of application that the environment runs, and determines what resources Elastic Beanstalk provisions to support it. - environment tier - application version - saved configuration - platform
environment tier
When you submit a form using the HTTP _________ method, any data in the form is concatenated to the URL shown in the browser. .- getParameter() - get - .getAttribute() - post
get
When you submit a form using the HTTP _________ method, any data in the form is added to the HTTP request message but not visible in the browser. - .getAttribute() - get - .getParameter() - post
post
If a prepared statement preparedStatement is a SQL SELECT statement, you execute the SQL query statement using _________. preparedStatement.executeQuery(); preparedStatement.execute(); preparedStatement.query(); preparedStatement.executeUpdate();
preparedStatement.executeQuery();
Assume that a database contains several records for the last name of Smith. Analyze the following code: PreparedStatement ps = connection.prepareStatement("select firstName, mi, lastName from Student where lastName = ?";ps.setString(1, "Smith");ResultSet resultSet = ps.executeQuery();resultSet.next();System.out.println(resultSet.getString(1)); - If the SQL SELECT statement returns no result, resultSet is null. - The program will have a runtime error, because the cursor in resultSet does not point to a row. You must use resultSet.next() to move the cursor to the first row in the result set. Subsequently, resultSet.next() moves the cursor to the next row in the result set. - resultSet.getString(1) returns the firstName field in the result set. - resultSet.getString(1) returns the mi field in the result set.
resultSet.getString(1) returns the firstName field in the result set.
Which of the following methods will move the cursor for the ResultSet rs one record forward? - rs. getRow() - rs.close() - rs.next() - rs.last()
rs.next()
___________________ is a design principle for separating a computer program into distinct sections such that each section addresses a separate concern.
separation of concerns
Assume that you move the cursor of a ResultSet rs forward one record, but there are no more records there. What would be the result? - a NoRecordFound exception - the rs.next() method would return a value of true - the rs.next() method would return a value of false - the rs.next() method would return a null value
the rs.next() method would return a value of false
Which of the following Eclipse Dynamic Web Project folders is the best place to import the Connector/J jar file? - webapps/Web-Inf -webapps - webapps/Web-Inf/lib - src
webapps/Web-Inf/lib