Explain Types Of Jdbc Drivers In Detail.

Hello Friends, In this blog post(Types Of Jdbc Drivers In Detail) we are going to let you know about the types of JDBC drivers in detail inside java.

Jdbc drivers are nothing but a software component which enable the java application to interact with the database.|Types Of Jdbc Drivers In Detail|

There are four types of JDBC drivers and each driver will have its own advantages and disadvantages, as well. Let us have a look at these drivers one by one.|Types Of Jdbc Drivers In Detail|

Type 1: JDBC-ODBC Bridge Driver

This driver receives any JDBC calls and sends them to ODBC(open database connectivity) driver. ODBC driver understands these calls and communicates with the database library provided by the vendor.

So, the ODBC driver, and the vendor database library must be present on the client machine. See the below fig.

type1 driver-types of jdbc drivers
Type1 driver-types of jdbc drivers

Advantages:

the JDBC-ODBC bridge allows access to almost any database since the database’s ODBC drivers are already available on the client machine.

Disadvantages:

The performance of this driver is less, since the JDBC call goes trough the bridge to the ODBC driver, then the native database connectivity library. The result comes back through the reverse process.

Another requirement is that the ODBC driver and the native database connectivity library must already installed on the client machine.

Type 2: Native API-Partly java driver-

It converts JDBC calls into database-specific calls with the help of the vendor database library. The type 2 driver communicates directly with the database server, therefore it requires that some binary code be present on the client machine. See the below fig.

type2 driver- types of jdbc drivers
Type 2 driver- types of jdbc drivers

Advantages:

Type 2 drivers typically offer better performance than the JDBC-ODBC bridge.

Disadvantages:

The vendor database library needs to be loaded on each client machine. This is the reason type 2 drivers can not be used for the internet. Type 2 drivers show lower performance than type 3 and type 4 drivers.

Type 3: Net protocol-pure java driver

It follows a three-tiered approach whereby the JDBC database requests are passed through the network to a middle-tier server(Ex- Net Server). The middle-tier server translates the request to the database-specific library and then sends it to the database server. The database server then executes the request and gives back the results. See the below fig.

type3 driver- types of jdbc drivers
Type 3 driver- types of jdbc drivers

Advantages:

This driver is server-based. so there is no need for any vendor database library to the present on the client machine.

Disadvantages:

Type 3 drivers Require database-specific coding to be done in the middle tier(in net server). Maintenance of the middle-tier server becomes costly.

Type 4: Native protocol-Pure java driver:

This driver converts the JDBC calls into the vendor-specific database management system(DBMS) protocol so that the client application can communicate directly with the database server. Level 4 drivers are completely implemented in Java to achieve platform independence and eliminate deployment administration issues. See the below fig.

type4 driver- types of jdbc drivers
Type 4 driver- types of jdbc drivers

Advantages:

This driver has better performance than Type 1 and Type 2. Also, there is no need to install any special software on the client or server.

Disadvantages:

With type 4 drivers, the user needs a different driver for each database. For example, to communicate with the oracle server, we need an oracle driver and to communicate with the Sybase server, we need a Sybase driver.

Conclusion:

So friends, within this blog post(Types Of Jdbc Drivers In Detail) we have gone through the types of JDBC drivers. JDBC helps to communicate with any database through a java program which is an essential feature for any project development environment since each software requires data representing different transactions to be stored and retrieved later on-demand.

JDBC eliminates the need of mastering the commands to communicate with different databases by providing a common mechanism to communicate with any database in the world. Each time the database is changed, the java program needs not to be changed and hence this provides better maintenance of code across different platforms.|Types Of Jdbc Drivers In Detail|

In the case of any queries, you can write to us at [email protected] we will get back to you ASAP.

Hope! you would have enjoyed this post about Types Of Jdbc Drivers In Detail.

Please feel free to give your important feedbacks in the comment section below.

Have a great time!

Anurag

I am a blogger by passion, a software engineer by profession, a singer by consideration and rest of things that I do is for my destination.