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 : A

Explanation

JDBC stands for Java Database Connectivity.

Q 2 - Which of the following encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed?

A - DriverManager

B - JDBC driver

C - Connection

D - Statement

Answer : D

Explanation

Statement encapsulates an SQL statement which is passed to the database to be parsed, compiled, planned and executed.

Q 3 - Which of the following type of JDBC driver, calls database vendor native library on a client side. This code then talks to database over network?

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

Answer : B

Explanation

Native-API, partly Java driver calls database vendor native library on a client side. This code then talks to database over network.

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

Answer : D

Explanation

TRANSACTION_WRITE_UNCOMMITTED is not a standard isolation levels defined by JDBC.

Q 5 - 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 : B

Explanation

ResultSet executeQuery(): This is used generally for reading the content of the database. The output will be in the form of ResultSet. Generally SELECT statement is used.

Answer : C

Explanation

Batch Processing allows you to group related SQL statements into a batch and submit them with one call to the database.

Q 7 - Out of String or a java.sql.Clob, which has best performance when used to manipulate data from database?

A - String

B - java.sql.Clob

Answer : B

Explanation

java.sql.Clob has better performance as it does not extract any data from the database until you explicitly ask it to.

Answer : C

Explanation

A JDBC RowSet object holds tabular data in a way that makes it more flexible and easier to use than a result set. A RowSet objects are JavaBeans components.

Q 9 - A disconnected RowSet object is ad-hoc in nature. Whenever it requires retrieving data from the database, it establishes the connection and closes it upon finishing the required task.

A - true

B - false

Answer : A

Explanation

A disconnected RowSet object is ad-hoc in nature. Whenever it requires retrieving data from the database, it establishes the connection and closes it upon finishing the required task.

Answer : C

Explanation

Hibernate is an Object-Relational Mapping tool. It maps Objects to relational data.


jdbc_questions_answers.htm

Advertisements