(TCOs 1, 5, and 6) Which of the following statements is FALSE given that your Ja
ID: 3814415 • Letter: #
Question
(TCOs 1, 5, and 6) Which of the following statements is FALSE given that your Java program is accessing a MySQL database? (Points : 3) If the database is not available, the program will have a runtime error when attempting to create a connection object.A connection object is required to create SQL statements that manipulate databases.
If the driver for MySQL is not in the classpath, the program will have a syntax error.
If the driver for MySQL is not in the classpath, the program will have a runtime error indicating that the driver class cannot be loaded. Question 2.2. (TCOs 1, 5, and 6) This SQL keyword is used to add a row to a table. (Points : 3) CREATE
UPDATE
INSERT
ADD Question 3.3. (TCOs 1, 5, and 6) What exception is thrown if the driver for MySQL is not loaded in the classpath? (Points : 3) NoSuchClassException
ClassCastException
ClassNotFoundException
IllegalClassException Question 4.4. (TCOs 1, 5, and 6) A _____ object holds the data that is returned from executing a select statement query. (Points : 3) MetaData
Results
QuerySet
ResultSet Question 5.5. (TCOs 1, 5, and 6) The Java compiler requires which type of exception to be handled with a try-catch block? (Points : 3) Runtime
Error
Checked
Unchecked Question 6.6. (TCOs 1, 5, and 6) Which of the following statements is FALSE? (Points : 3) PreparedStatement can only be used for SQL SELECT statements.
The parameters in a prepared statement are specified using the ? character.
PreparedStatement is efficient for repeated executions.
PreparedStatement is a subinterface of Statement. Question 7.7. (TCOs 1, 5, and 6) Which statement is used to execute the query “Select * from products” using the Statement object stmt? (Points : 3) stmt.executeUpdate(“Select * from products”);
stmt.exectue(“Select * from products”);
stmt.exectueQuery(“Select * from products”);
stmt.query(“Select * from products”); Question 8.8. (TCOs 1, 5, and 6) What statement needs to be included below to retrieve all rows from the Invoices table with InvoiceTotal greater than 100?
String sql = "SELECT InvoiceDate, InvoiceTotal "
+ "FROM Invoices WHERE InvoiceTotal > ?";
PreparedStatement ps = connection.prepareStatement(sql);
//what goes here
ResultSet invoices = ps.executeQuery(); (Points : 3) ps.setValue(0, 100);
ps.setValue(1, 100);
ps.setDouble(0, 100);
ps.setDouble(1, 100); Question 9.9. (TCOs 1, 5, and 6) What must you make available to your application before you can use JDBC to connect to a database? (Points : 3) A database driver
A web server
A firewall
An ODBC data source Question 10.10. (TCOs 1, 5, and 6) The results of a query may be displayed on a GUI in a grid format using a _____ object. (Points : 3) TableModel
ModelTable
JTable
JQuery (TCOs 1, 5, and 6) Which of the following statements is FALSE given that your Java program is accessing a MySQL database? (Points : 3) If the database is not available, the program will have a runtime error when attempting to create a connection object.
A connection object is required to create SQL statements that manipulate databases.
If the driver for MySQL is not in the classpath, the program will have a syntax error.
If the driver for MySQL is not in the classpath, the program will have a runtime error indicating that the driver class cannot be loaded.
Explanation / Answer
HI, I have answered first 5 questions.
Please repost others in separate post.
Please let me know in case of any issue in first 5.
Which of the following statements is FALSE given that your Java program is accessing a MySQL database? (Points : 3)
If the database is not available, the program will have a runtime error when attempting to create a connection object.
A connection object is required to create SQL statements that manipulate databases.
If the driver for MySQL is not in the classpath, the program will have a syntax error.
If the driver for MySQL is not in the classpath, the program will have a runtime error indicating that the driver class cannot be loaded.
Ans:
A connection object is required to create SQL statements that manipulate databases.
If the driver for MySQL is not in the classpath, the program will have a syntax error.
Question 2.2.This SQL keyword is used to add a row to a table. (Points : 3)
CREATE
UPDATE
INSERT
ADD
Ans: INSERT
Question 3.3.What exception is thrown if the driver for MySQL is not loaded in the classpath? (Points : 3)
NoSuchClassException
ClassCastException
ClassNotFoundException
IllegalClassException
Ans: ClassNotFoundException
Question 4.4.A _____ object holds the data that is returned from executing a select statement query. (Points : 3)
MetaData
Results
QuerySet
ResultSet
Ans: ResultSet
Question 5.5.The Java compiler requires which type of exception to be handled with a try-catch block? (Points : 3)
Runtime
Error
Checked
Unchecked
Ans: Checked
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.