Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
10 views10 pages

JDBC Drivers

JDBC drivers are essential software components that enable the JDBC API to communicate with databases. There are four types of JDBC drivers: Type 1 (JDBC-ODBC Bridge), Type 2 (Native API), Type 3 (Network Protocol), and Type 4 (Native Protocol), each with varying performance, portability, and complexity. Type 4 drivers are the most popular due to their direct communication with databases and full Java implementation, eliminating the need for additional middleware.

Uploaded by

prernasingh9804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views10 pages

JDBC Drivers

JDBC drivers are essential software components that enable the JDBC API to communicate with databases. There are four types of JDBC drivers: Type 1 (JDBC-ODBC Bridge), Type 2 (Native API), Type 3 (Network Protocol), and Type 4 (Native Protocol), each with varying performance, portability, and complexity. Type 4 drivers are the most popular due to their direct communication with databases and full Java implementation, eliminating the need for additional middleware.

Uploaded by

prernasingh9804
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

JDBC Drivers

• JDBC API cannot not directly communicate


with the database. It uses JDBC driver of the
database to interact with the database.
• JDBC driver is a software component provided
along with the database which is required by
the JDBC API to interact with the database.
Types Of JDBC Drivers :

• Type 1 JDBC Driver / JDBC-ODBC Bridge Driver


• Type 2 JDBC Driver / Native API Driver
• Type 3 JDBC Driver / Network Protocol Driver
• Type 4 JDBC Driver / Native Protocol Driver
Type 1 JDBC Driver
JDBC-ODBC Bridge Driver
• Type 1 JDBC Drivers provide the bridge between
JDBC and ODBC API and hence the name ‘JDBC-
ODBC Bridge Drivers’.
• This type of drivers translate all JDBC calls into
ODBC calls and sends them to ODBC driver which
interacts with the database.
• These types of drivers are slowest of all types.
Because, all JDBC calls will go to the ODBC driver
through the bridge and then to database.
• This driver is not entirely written in java language.
It causes the portability issues.
Type 2 JDBC Driver
Native API Driver
• Type 2 JDBC Driver translates all JDBC method calls
into database specific calls using native API of the
database.
• Its performance is slightly better than the Type 1 driver
as communication layer is reduced in this driver.
• But, like Type 1 Driver, it is also not entirely written
in java language. This causes the portability issues.
• And also this driver is database specific. So once you
switch from one database to another, you have to
change the driver. That is also one of the disadvantage
of this driver.
Type 3 JDBC Driver
Network Protocol Driver
• Type 3 JDBC Drivers make use of middle
ware or application server that translates all
JDBC calls into database specific calls.
• One of the main advantage of this driver is
that it is entirely written in java language. So
no portability issues.
• But it is costly as extra application server or
middle ware component has to be
maintained.
Type 4 JDBC Driver
Native Protocol Driver
• Type 4 JDBC Driver is also called Thin Driver as it
directly converts JDBC calls into database specific
calls.
• This driver is most popular among all 4 type of
JDBC drivers.
• This driver is preferred over Type 3 Driver as it
removes extra layer of communication
(Application Server / Middle ware) and this
makes it faster than the Type 3 JDBC Driver. And
also, like Type 3 JDBC Driver, It is also entirely
written in java language and hence portable.

You might also like