Apr 18

To connect with individual databases, JDBC requires drivers for each database. The JDBC driver gives out the connection to the database and implements the protocol for transferring the query and result from client to database. All advantages and disadvantages of two types of JDBC drivers are elaborated in detail.

JDBC-ODBC Bridge driver. This is a type 1 of JDBC bridge drivers, which translates all JDBC calls into ODBC calls and sends them to the ODBC driver. ODBC is a generic API. The JDBC-ODBC Bridge driver is recommended only for experimental use or when no other alternative is available. The main advantage of this JDBC bridge driver is that it allows access to almost any database, since the database’s ODBC drivers are already available. The disadvantages of this type of driver may appear in different occasions:

  • Since the Bridge driver is not written fully in Java, Type 1 drivers are not portable.
  • A performance issue is seen as a JDBC call goes through the bridge to the ODBC driver, then to the database, and this applies even in the reverse process. They are the slowest of all driver types.
  • The client system requires the ODBC Installation to use the driver.
  • Not good for the Web.

The distinctive characteristic of the second type of jdbc drivers are that these drivers convert JDBC calls into database-specific calls i.e. this driver is specific to a particular database. The distinctive characteristic of type 2 jdbc drivers are that they are typically offer better performance than the JDBC-ODBC Bridge as the layers of communication (tiers) are less than that of Type 1 and also it uses Native api which is Database specific. Disadvantages may be the following:

  • Native API must be installed in the Client System and hence type 2 drivers cannot be used for the Internet.
  • Like Type 1 drivers, it’s not written in Java Language which forms a portability issue.
  • If we change the Database we have to change the native api as it is specific to a database.
  • Mostly obsolete now.
  • Usually not thread safe.

written by rajit \\ tags: , ,