Introduction JDBC Driver

JDBC drivers implement the defined interfaces in the JDBC API for interacting with your database server.Sun has divided the implementation 4 types of JDBC drivers:

  • JDBC-ODBC bridge driver
  • Native-API driver (partially java driver)
  • Network Protocol driver (fully java driver)
  • Thin driver (fully java driver)

Type 1: JDBC-ODBC Bridge Driver:

In a Type 1 driver, a JDBC bridge is used to access ODBC drivers installed on each client machine. Using ODBC requires configuring on your system a Data Source Name (DSN) that represents the target database.
This is now discouraged because of thin driver

Nativeapidriver

Advantages:

  • easy to use.
  • can be easily connected to any database.
  • single driver implementation can be use with all the database because sported by the all the database.

Disadvantages:

  • Performance degraded because JDBC method call is converted into the ODBC funcion calls.
  • The ODBC driver needs to be installed on the client machine.

2-Native-API driver (partially java driver)

The Native API driver uses the client-side libraries of the database. The driver converts JDBC method calls into native calls of the database API.

Nativeapidriver

Advantage

  1. ODBC Driver is not required.
  2. Beater performance is often as compared to type 1 driver ODBC-Native and Native-ODBC convection to the resume.

Disadvantage

  1. Native driver is required as each machine where application is to be execute.
  2. For each database different implements of driver is required.

3- Network Protocol driver (fully java driver)

In this driver JDBC driver class invoked function driver over the network. In this driver implementation classes of JDBC interface invokes function of native drivers over the network using the standard network protocols such as TCP/IP.

Nativeapidriver

Advantage

  1. native driver need to install only on a single machine on a network

Disadvantage

  1. Network support is required on client machine.
  2. Requires database-specific coding to be done in the middle tier.
  3. Maintenance of Network Protocol driver becomes costly because it requires database-specific coding to be done in the middle tier.

Type4 Pure Java Native Driver

In this driver driver class directly interacts to the database using database specific the protocol.

Nativeapidriver

Advantage

  1. ODBC-native driver is not required.
  2. Better performance is often as compare to other driver.

Disadvantage

  1. Drivers depends on the Database