Table of Contents
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
- JDBC-ODBC bridge driver
- Native-API driver (partially java driver)
- Network Protocol driver (fully java driver)
- 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.
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.
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.