Types of JDBC Drivers – Introduction to Java JDBC Drivers

3K views 3 minutes read
A+A-
Reset

JDBC is java API that is used to connect and execute query to the database. JDBC API consists of classes and interfaces which are used to communicate with any kind of the database.

Different types of JDBC drivers also developed implementing JDBC API. JDBC API is part of java standard edition (Java SE) and enterprise edition (Java EE).

JDBC driver is software component that enables java application to interact with database. There different drivers available in market targeted for different databases. All JDBC  drivers are categorized into following four types.

  1. JDBC-ODBC Bridge Driver (Type I).
  2. Native API Driver (Type II).
  3. Network Protocol Driver (Type III).
  4. Thin Driver (Type IV).

Below are different Types of JDBC drivers.

JDBC-ODBC Bridge Driver (Type I)

The JDBC-ODBC Bridge driver uses ODBC driver to connect the database. ODBC is the driver for database connectivity since early years and capable of connecting almost any kind of databases. The JDBC-ODBC bridge driver converts JDBC calls to ODBC calls. ODBC driver in turn convert these calls to database specific calls with the help of database library.

Advantage:

  • Easy to use.
  • Can be used to connect any type of database.

Disadvantages

  • Performance is less because three conversions are required.
  • Data Source Name(DSN) should be provided.
  • ODBC driver and Database library are necessary in client machine.

Native API Driver (Type II)

Native API driver uses the client side libraries of database to talk with database. The driver converts JDBC method calls into native calls of the database API. It is partially written in java so also known as partial java driver. Here vendor specific database library is required in client machine.

Advantage:

  • Performance is better as compared to type I driver.

Disadvantages:

  • The vendor client library need to be installed in client
  • Platform dependent driver because it is not fully written in java
JDBC Driver Types

JDBC Driver Types

Network Protocol Driver (Type III)

The network protocol driver use middle ware that convert JDBC calls directly or indirectly into the vendor specific database protocol. It is entirely written in java. So it is also called pure java driver for database middle ware. Here same driver can be used for multiple databases. It is used where three tier communication approach is used.

Advantages:

  • No need of database vendor specific library in client machine.
  • Single driver can handle any database.
  • Middle ware also provide facility of caching, load balancing, logging and auditing.

Disadvantages:

  • Database specific coding may be required in middle ware.
  • Increased latency due to presence of middle ware.
  • Important factor is cost of maintaining application server(Middle ware)

Thin Driver (Type IV)

Type IV driver directly converts JDBC calls directly into vendor specific protocol. It provides better performance as compared to type I or type III drivers. It is entirely written in java. So, this is called pure java driver.

Advantages:

  • It is platform independent.
  • Better performance than other driver.
  • Easy to manage

Disadvantages:

  • Drivers are database dependent so there are separate driver for each database.

Note:

First, Driver type I is no more in use.

Secondly, Type III driver is used in large organizations.

Next, Type IV is mostly used

And Finally, Type II may be used where Type IV is not possible to implement.

Related Posts

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Index

Adblock Detected

Please support us by disabling your AdBlocker extension from your browsers for our website.