• +91 9723535972
  • info@interviewmaterial.com

JDBC Interview Questions and Answers

JDBC Interview Questions and Answers

Question - 11 : - What Are Types Of Jdbc Drivers?

Answer - 11 : -

There are four types of drivers defined by JDBC as follows:

  • Type 1: JDBC/ODBC—These require an ODBC (Open Database Connectivity) driver for the database to be installed. This type of driver works by translating the submitted queries into equivalent ODBC queries and forwards them via native API calls directly to the ODBC driver. It provides no host redirection capability.
  • Type2: Native API (partly-Java driver)—This type of driver uses a vendor-specific driver or database API to interact with the database. An example of such an API is Oracle OCI (Oracle Call Interface). It also provides no host redirection.
  • Type 3: Open Protocol-Net—This is not vendor specific and works by forwarding database requests to a remote database source using a net server component. How the net server component accesses the database is transparent to the client. The client driver communicates with the net server using a database-independent protocol and the net server translates this protocol into database calls. This type of driver can access any database.
  • Type 4: Proprietary Protocol-Net(pure Java driver)—This has a same configuration as a type 3 driver but uses a wire protocol specific to a particular vendor and hence can access only that vendor's database. Again this is all transparent to the client.

Question - 12 : - Which Type Of Jdbc Driver Is The Fastest One?

Answer - 12 : -

JDBC Net pure Java driver(Type IV) is the fastest driver because it converts the JDBC calls into vendor specific protocol calls and it directly interacts with the database.

Question - 13 : - Does The Jdbc-odbc Bridge Support Multiple Concurrent Open Statements Per Connection?

Answer - 13 : -

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

Question - 14 : - Which Is The Right Type Of Driver To Use And When?

Answer - 14 : -

  • Type I driver is handy for prototyping.
  • Type III driver adds security, caching, and connection control.
  • Type III and Type IV drivers need no pre-installation.

Question - 15 : - What Are The Standard Isolation Levels Defined By Jdbc?

Answer - 15 : -

The values are defined in the class java.sql.Connection and are:

  • TRANSACTION_NONE
  • TRANSACTION_READ_COMMITTED
  • TRANSACTION_READ_UNCOMMITTED
  • TRANSACTION_REPEATABLE_READ
  • TRANSACTION_SERIALIZABLE
Any given database may not support all of these levels.

Question - 16 : - What Is Resultset ?

Answer - 16 : -

The ResultSet represents set of rows retrieved due to query execution.

ResultSet rs = stmt.executeQuery(sqlQuery);

Question - 17 : - What Is Rowset?

Answer - 17 : -

A RowSet is an object that encapsulates a set of rows from either Java Database Connectivity (JDBC) result sets or tabular data sources like a file or spreadsheet. RowSets support component-based development models like JavaBeans, with a standard set of properties and an event notification .

Question - 18 : - What Are The Different Types Of Rowset ?

Answer - 18 : -

There are two types of RowSet are there. They are:

  • Connected - A connected RowSet object connects to the database once and remains connected until the application terminates.
  • Disconnected - A disconnected RowSet object connects to the database, executes a query to retrieve the data from the database and then closes the connection. A program may change the data in a disconnected RowSet while it is disconnected. Modified data can be updated in the database after a disconnected RowSet reestablishes the connection with the database.

Question - 19 : - What Is The Need Of Batchupdates?

Answer - 19 : -

The BatchUpdates feature allows us to group SQL statements together and send to database server in one single trip.

Question - 20 : - What Is A Datasource?

Answer - 20 : -

A DataSource object is the representation of a data source in the Java programming language. In basic terms,

  • A DataSource is a facility for storing data.
  • DataSource can be referenced by JNDI.
  • Data Source may point to RDBMS, file System , any DBMS etc..


NCERT Solutions

 

Share your email for latest updates

Name:
Email:

Our partners