Home Java Tutorial Types of JDBC drivers

Types of JDBC drivers

by anupmaurya
3 minutes read

In this article, you’ll learn about Types of JDBC drivers such as JDBC-ODBC bridge driver, Native-API driver,
Network Protocol driver and Thin driver.

JDBC driver is a software component which enables Java applications to interact with the database.

There are four types of JDBC drivers

  1. JDBC-ODBC bridge driver
  2. Native-API driver (partially java driver)
  3. Network Protocol driver (fully java driver)
  4. Thin driver (fully java driver)

Let have a deep look on each of the JDBC drivers

1. Type-1 Driver or JDBC-ODBC Bridge

This driver acts as a bridge between JDBC and ODBC. It converts JDBC calls into ODBC calls and then sends the request to the ODBC driver. It is easy to use but the execution time is slow.


2. Type-2 Driver or Native API Partly Java Driver

This driver uses JNI (Java Native Interface) call on database specific native client API. It is comparatively faster than Type-1 driver but it requires native library and cost of application also increases.

Native API Partly Java Driver

3. Type-3 Driver or Network Protocol Driver

These drivers communicate to JDBC middleware server using proprietary network protocol. This middleware translates the network protocol to database specific calls. They are database independent. They can switch from one database to another but are slow due to many network calls.

Network Protocol Driver

4. Type-4 or Thin Driver

This driver is also called pure Java driver because they directly interact with the database. It neither requires any native library nor middleware server. It has better performance than other drivers but comparatively slow due to an increase in a number of network calls.

Thin Driver

You may also like

Adblock Detected

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