JDBC Mock Test II
JDBC Mock Test II
This section presents you various set of Mock Tests related to JDBC Framework. You can
download these sample mock tests at your local machine and solve offline at your convenience.
Every mock test is supplied with a mock test key to let you verify the final score and grade yourself.
Q 1 - Which of the following type of JDBC driver, is also called Type 3 JDBC driver?
Q 2 - Which of the following type of JDBC driver, is also called Type 4 JDBC driver?
Q 3 - Which of the following type of JDBC driver should be used when you are
accessing one type of database, such as Oracle, Sybase, or IBM?
A - Type 1
B - Type 2
C - Type 3
D - Type 4
Q 4 - Which of the following type of JDBC driver should be used if your Java application
is accessing multiple types of databases at the same time?
A - Type 1
B - Type 2
C - Type 3
D - Type 4
Q 5 - Which of the following type of JDBC driver should be used where a type 3 or type
4 driver is not available yet for your database?
A - Type 1
B - Type 2
C - Type 3
D - Type 4
Q 6 - Which of the following type of JDBC driver is typically used for development and
testing purposes only?
A - Type 1
B - Type 2
C - Type 3
D - Type 4
A - Type 1
B - Type 2
C - Type 3
D - Type 4
A - true
B - false
Q 9 - Which of the following is not the standard isolation levels defined by JDBC?
A - TRANSACTION_NONE
B - TRANSACTION_READ_COMMITTED
C - TRANSACTION_READ_UNCOMMITTED
D - TRANSACTION_WRITE_UNCOMMITTED
Q 10 - Which of the following is not the standard isolation levels defined by JDBC?
A - TRANSACTION_NONE
B - TRANSACTION_REPEATABLE_READ
C - TRANSACTION_SERIALIZABLE
D - TRANSACTION_REPEATABLE_WRITE
A - The JDBC API provides the abstraction and the JDBC drivers provide the implementation.
B - New drivers can be plugged-in to the JDBC API without changing the client code.
A - The JDBC API provides the abstraction and the JDBC drivers provide the implementation.
B - New drivers can be plugged-in to the JDBC API without changing the client code.
A - Statement
B - PreparedStatement
C - CallableStatement
D - QueryStatement
A - Statement
B - PreparedStatement
C - CallableStatement
A - Statement
B - PreparedStatement
C - CallableStatement
A - Statement
B - PreparedStatement
C - CallableStatement
B - Prepared statements reuse the same execution plan for different arguments rather than
creating a new execution plan every time.
C - Prepared statements use bind arguments, which are sent to the database engine.
A - PreparedStatement allows mapping different requests with same prepared statement but
different arguments to execute the same execution plan.
B - Prepared statements are more secure because they use bind variables, which can prevent
SQL injection attack.
A - This method dynamically loads the driver's class file into memory, which automatically
registers it.
B - This method is preferable because it allows you to make the driver registration configurable
and portable.
B - This static method is used in case you are using a non-JDK compliant JVM, such as the one
provided by Microsoft.
A - Auto loading of JDBC driver class. In the earlier versions we had to manually register and load
drivers using class.forName.
A - boolean execute
B - ResultSet executeQuery
C - int executeUpdate
Q 25 - Which of the following is used generally for reading the content of the
database?
A - boolean execute
B - ResultSet executeQuery
C - int executeUpdate
ANSWER SHEET
1 C
2 D
3 D
4 C
5 B
6 A
7 D
8 B
9 D
10 C
11 C
12 C
13 C
14 D
15 A
16 B
17 C
18 D
19 C
20 C
21 C
22 C
23 C
24 A
25 B
Loading [MathJax]/jax/output/HTML-CSS/jax.js