[go: up one dir, main page]

0% found this document useful (0 votes)
134 views6 pages

JDBC Mock Test II

Test

Uploaded by

rahul verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
134 views6 pages

JDBC Mock Test II

Test

Uploaded by

rahul verma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

JDBC MOCK TEST

http://www.tutorialspoint.com Copyright © tutorialspoint.com

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.

JDBC MOCK TEST II

Q 1 - Which of the following type of JDBC driver, is also called Type 3 JDBC driver?

A - JDBC-ODBC Bridge plus ODBC driver

B - Native-API, partly Java driver

C - JDBC-Net, pure Java driver

D - Native-protocol, pure Java driver

Q 2 - Which of the following type of JDBC driver, is also called Type 4 JDBC driver?

A - JDBC-ODBC Bridge plus ODBC driver

B - Native-API, partly Java driver

C - JDBC-Net, pure Java driver

D - Native-protocol, pure Java 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

Q 7 - Which of the following type of JDBC driver is the fastest one?

A - Type 1

B - Type 2

C - Type 3

D - Type 4

Q 8 - The JDBC-ODBC Bridge support multiple concurrent open statements per


connection.

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

Q 11 - Which of the following is correct about JDBC?

A - JDBC architecture decouples an abstraction from its implementation.

B - JDBC follows a bridge design pattern.

C - Both of the above.

D - None of the above.

Q 12 - Which of the following is correct about JDBC?

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.

C - Both of the above.

D - None of the above.

Q 13 - Which of the following is correct about JDBC?

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.

C - Both of the above.

D - None of the above.

Q 14 - Which of the following is not a valid type of statement in JDBC?

A - Statement

B - PreparedStatement

C - CallableStatement

D - QueryStatement

Q 15 - Which of the following represents a regular SQL statement in JDBC?

A - Statement

B - PreparedStatement

C - CallableStatement

D - None of the above.


Q 16 - Which of the following is efficient than statement due to pre-compilation of
SQL?

A - Statement

B - PreparedStatement

C - CallableStatement

D - None of the above.

Q 17 - Which of the following is used to call stored procedures on the database?

A - Statement

B - PreparedStatement

C - CallableStatement

D - None of the above.

Q 18 - Which of the following is correct about PreparedStatement?

A - Prepared statements offer better performance, as they are pre-compiled.

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.

D - All of the above.

Q 19 - Which of the following is correct about PreparedStatement?

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.

C - Both of the above.

D - None of the above.

Q 20 - Which of the following is correct about Class.forName method call?

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.

C - Both of the above.

D - None of the above.

Q 21 - Which of the following is correct about DriverManager.registerDriver method


call?

A - This method is used to register the database driver.

B - This static method is used in case you are using a non-JDK compliant JVM, such as the one
provided by Microsoft.

C - Both of the above.

D - None of the above.

Q 22 - Which of the following is correct about JDBC 4.0?

A - Auto loading of JDBC driver class. In the earlier versions we had to manually register and load
drivers using class.forName.

B - Connection management enhancements. New methods added to javax.sql.PooledConnection.

C - Both of the above.

D - None of the above.

Q 23 - Which of the following is correct about JDBC 4.0?

A - DataSet Implementation of SQL using annotations.

B - SQL XML support.

C - Both of the above.

D - None of the above.

Q 24 - Which of the following executes the any kind of SQL statement?

A - boolean execute

B - ResultSet executeQuery

C - int executeUpdate

D - None of the above.

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

D - None of the above.

ANSWER SHEET

Question Number Answer Key

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

You might also like