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.
Q 1 - Which of the following is correct about Connection interface of JDBC?
Connection interface consists of methods for contacting a database. The connection object represents communication context.
Q 2 - Which of the following manages a list of database drivers in JDBC?
DriverManager class manages a list of database drivers in JDBC.
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?
Native-API, partly Java driver calls database vendor native library on a client side. This code then talks to database over network.
Q 4 - The JDBC-ODBC Bridge support multiple concurrent open statements per connection.
No. You can open only one Statement object per connection when you are using the JDBC-ODBC Bridge.
Q 5 - Which of the following is correct about PreparedStatement?
PreparedStatement allows mapping different requests with same prepared statement but different arguments to execute the same execution plan. Prepared statements are more secure because they use bind variables, which can prevent SQL injection attack.
Q 6 - Which of the following is correct about stored procedures?
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.
Q 7 - Which of the following is correct about connection pooling?
Connection Pooling is a technique used for reuse of physical connections and reduced overhead for your application. Connection pooling functionality minimizes expensive operations in the creation and closing of sessions.
Q 8 - Which of the following is correct about Disconnected RowSet?
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. The data that is modified during disconnected state is updated after the connection is re-established.
Q 9 - Which isolation level prevents dirty read in JDBC, connection class?
TRANSACTION_READ_COMMITTED prevents dirty read in JDBC, connection class.
Q 10 - New drivers can be plugged-in to the JDBC API without changing the client code.
New drivers can be plugged-in to the JDBC API without changing the client code.