JDBC Online Quiz


Advertisements


Following quiz provides Multiple Choice Questions (MCQs) related to JDBC Framework. You will have to read all the given answers and click over the correct answer. If you are not sure about the answer then you can check the answer using Show Answer button. You can use Next Quiz button to check new set of questions in the quiz.

Questions and Answers

Answer : C

Explanation

JDBC DriverManager is a class that manages a list of database drivers. It matches connection requests from the java application with the proper database driver using communication subprotocol.

Q 2 - Which of the following gives out the connection to the database and implements the protocol for transferring the query and result between client and database?

A - DriverManager

B - JDBC driver

C - Connection

D - Statement

Answer : B

Explanation

JDBC driver gives out the connection to the database and implements the protocol for transferring the query and result between client and database.

Q 3 - 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

Answer : C

Explanation

If your Java application is accessing multiple types of databases at the same time, type 3 is the preferred driver.

Q 4 - The JDBC-ODBC Bridge support multiple concurrent open statements per connection.

A - true

B - false

Answer : B

Explanation

No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.

Answer : C

Explanation

Both of the above are correct about JDBC 4.0.

Answer : C

Explanation

A stored procedure is a group of SQL statements that form a logical unit and perform a particular task. For example operations on an employee database (hire, fire, promote, lookup) could be coded as stored procedures executed by application code. Stored procedures can be called using CallableStatement class in JDBC API.

Answer : C

Explanation

Database vendor's help multiple clients to share a cached set of connection objects that provides access to a database. Clients need not create a new connection everytime to interact with the database.

Answer : D

Explanation

Statement is used for general-purpose access to your database. Useful when you are using static SQL statements at runtime. The Statement interface cannot accept parameters.

Answer : C

Explanation

Open a connection using the DriverManager.getConnection () method actually establishes a connection with a database.

Q 10 - Which of the following is a Metadata interfaces of JDBC?

A - DatabaseMetaData

B - ResultSetMetaData

C - Both of the above.

D - None of the above.

Answer : C

Explanation

JDBC API has two Metadata interfaces : DatabaseMetaData & ResultSetMetaData.


jdbc_questions_answers.htm

Advertisements