Professional Documents
Culture Documents
Question 1 of 20
Which of the following methods are needed for loading a database driver in JDBC 5.0/ 5.0 Points
A. registerDriver() method
B. getConnection()
C. Class.forName()
D. Both A and B
Question 2 of 20
To uniquely identify each row in a table, a relational database uses a ? 0.0/ 5.0 Points
A. record
C. primary key
D. foreign key
Question 3 of 20
What a correct ordering of steps should be to using a updatable recordset to insert new 5.0/ 5.0 Points
customers into the Customer table.
A. G_I_C_J_A_B_K_E_H_D_F
B. I_G_C_J_A_B_E_K_H_D_F
C. I_G_C_J_A_B_K_E_H_D_F
D. G_I_C_J_A_B_K_E_D_H_F
Question 4 of 20
Which of following interface isn’t used by JDBC 0.0/ 5.0 Points
A. java.sql.Driver
B. java.sql.Connection
C. java.sql.DriverManager
D. java.sql.DatabaseMetaData
Question 5 of 20
A __________ result set has a cursor that moves both forward and backward and can be 0.0/ 5.0 Points
moved to a particular row
A. nonscrollable
B. Unscrollable
C. scrollable
Question 6 of 20
Package _______ contains classes and interfaces for manipulating relational databases in 5.0/ 5.0 Points
Java. ?
A. java.sql
B. sql.java
C. java.connection
D. sql.rar
Question 7 of 20
Which driver is efficient and always preferable for using JDBC applications 0.0/ 5.0 Points
A. Type – 1
B. Type – 4
C. Type – 2
D. Type – 3
Question 8 of 20
What statements are correct about JDBC transactions (2 correct answers)? 0.0/ 5.0 Points
Question 9 of 20
Which method is used to perform DML statements in JDBC 5.0/ 5.0 Points
A. executeUpdate()
B. executeQuery()
C. execute()
D. executeResult()
Question 10 of 20
Suppose that a database server does not support a pure JDBC driver, but it does support an 5.0/ 5.0 Points
ODBC driver. How can you access the database server using JDBC?
B. Use JNDI.
C. Use SQL.
A.
By setting the autoCommit property of the Connection to false, and execute a statement in the database
B. By asking a Transaction object to your Connection, and calling the method begin() on it
C.
By asking a Transaction object to your Connection, and setting the autoCommit property of the
Transaction to false
Question 12 of 20
Which of the following methods finds the maximum number of connections that a specific driver 0.0/ 5.0 Points
can obtain
A. ResultSetMetaData.getMaxConnections
B. DatabaseMetaData.getMaxConnections
C. Connection.getMaxConnections
D. Database.getMaxConnections
Question 13 of 20
Which of the following describes a JDBC type 4 driver? 0.0/ 5.0 Points
Question 14 of 20
How do you know in your Java program that a SQL warning is generated as a result of 0.0/ 5.0 Points
executing a SQL statement in the database
A. You must query the ResultSet object about possible warnings generated by the database
B.
You must catch the unchecked SQLWarningException which is thrown by the method which executes the
statement
C.
You must catch the checked SQLException which is thrown by the method which executes the statement
D. You must invoke the getWarnings() method on the Statement object (or a sub interface thereof)
Question 15 of 20
The result set retrieved by the following SELECT statement contains records that have 5.0/ 5.0 Points
A. two fields from the Accounts table where Balance is less than 0
B. two fields from the Balance table where Account Num is less than 0
C. one field from the Balance table where Account Num is less than 0
D. all fields from the Accounts table where Balance is less than 0
Question 16 of 20
Which of the following is false as far as type 4 driver is concern 0.0/ 5.0 Points
Question 17 of 20
A transaction is a set of one or more statements that is executed as a unit, it means 0.0/ 5.0 Points
______________
A.
You must sure that all statements are OK before executing it, otherwise, you can not execute this
transaction.
C. All of the statements are executed or some of the statements are executed, it's OK to JDBC.
D.
No problem, even in case some statements are committed and the others are rolled back, it's OK to
JDBC.
Question 18 of 20
A __________ object contains information about a result set like the numbers and names of the 0.0/ 5.0 Points
columns in the result set. ?
B. ResultSetMetaData
C. connection pooling
D. prepared statements
Question 19 of 20
The _______ interfaces is used to encapsulate SQL queries used for retrieving data from the 5.0/ 5.0 Points
database ?
A. Statement
B. Callable
C. Prepared
D. Parameter
Question 20 of 20
If one intends to work with a ResultSet, which of these PreparedStatement methods will not 0.0/ 5.0 Points
work?
A. executeQuery()
B. execute()
C. executeUpdate()
Gateway
Accessibility Information
The Sakai Project
Powered by Sakai
Copyright 2017 FPT-Software