JDBC - Chapter 4
JDBC - Chapter 4
Answer: A. Multithreaded
4. Which type of driver provides JDBC access via one or more ODBC drivers?
[A] Type 1 driver
[B] Type 2 driver
[C] Type 3 driver
[D] Type 4 driver
Explanation: none
5. Which type of driver converts JDBC calls into the network protocol used by the
database management system directly?
[A] Type 1 driver
[B] Type 2 driver
[C] Type 3 driver
[D] Type 4 driver
Explanation: none
Answer: C. AUTO_INCREMENT
8. ________ is an open source DBMS product that runs on UNIX, Linux and
Windows.
[A] MySQL
[B] JSP/SQL
[C] JDBC/SQL
[D] Sun ACCESS
Answer: A. MySQL
9. Which JDBC driver Type(s) can be used in either applet or servlet code?
[A] Both Type 1 and Type 2
[B] Both Type 1 and Type 3
[C] Both Type 3 and Type 4
[D] Type 4 only
11. Which of the following methods are needed for loading a database driver in
JDBC?
[A] registerDriver() method
[B] Class.forName()
[C] Both A and B
[D] getConnection()
12. Which of the following statements is false as far as different type of statements
is concern in JDBC?
[A] Regular Statement
[B] Prepared Statement
[C] Callable Statement
[D] Interim Statement
13. Which of the following allows non repeatable read in JDBC Connection?
[A] TRANSACTION_READ_UNCOMMITTED
[B] TRANSACTION_READ_COMMITTED
[C] TRANSACTION_SERIALIZABLE
[D] TRANSACTION_REPEATABLE_READ
Answer: D. TRANSACTION_REPEATABLE_READ
14. The JDBC-ODBC Bridge supports multiple concurrent open statements per
connection?
[A] True
[B] False
Answer: A. True
Answer: A. PreparedStatement
Answer: A. PreparedStatement
Explanation: ResultSet is the statement to get the string value , getBoolean, to the
query.
18. How can you execute a stored procedure in the database?
[A] Call method execute() on a CallableStatement object
[B] Call method executeProcedure() on a Statement object
[C] Call method execute() on a StoredProcedure object
[D] Call method run() on a ProcedureCommand object
19. What happens if you call the method close() on a ResultSet object?
[A] the method close() does not exist for a ResultSet. Only Connections can be closed.
[B] the database and JDBC resources are released
[C] you will get a SQLException, because only Statement objects can close ResultSets
[D] the ResultSet, together with the Statement which created it and the Connection
from which the Statement was retrieved, will be closed and release all database and
JDBC resources
Explanation: if you call the method close() , jdbc release all the resources.
Answer: B. The row you are positioned on is deleted from the ResultSet and from the
database
Explanation: The row you are positioned on is deleted from the ResultSet and from the
database
21. How many JDBC driver types does Sun define?
[A] one
[B] two
[C] three
[D] four
Answer: D. four
Answer : - A
Answer : - D
Answer : - B
Answer : - B
26. executeUpdate() method returns_____________________
A. Single row
B. ResultSet object
C. Integer
D. Single Column
Answer : - C
A. a-b-c-d-e
B. d-a-e-b-c
C. e-d-c-b-a
D. d-a-c-b-e
Answer : - B:
28. Native – protocol pure Java converts ……….. in to the ………… used by DBMSs
directly.
A. JDBC calls, network protocol
B. ODBC class, network protocol
C. ODBC class, user call
D. JDBC calls, user call
Answer: A: JDBC calls, network protocol
29. The JDBC-ODBC bridge driver resolves……….. and makes equivalent ………..
A. JDBC call, ODBC call
B. ODBC call, ODBC call
C. ODBC call, JDBC call
D. JDBC call, JDBC call
Answer: A: JDBC call, ODBC call
30. For execution of DELETE SQL query in JDBC, ............. method must be used.
A. executeQuery()
B. executeDeleteQuery()
C. executeUpdate()
D. executeDelete()
Answer: C: executeUpdate()
Answer: D: Parameterized