Types of JDBC Drivers:
Introduction:
As we know Java alone cannot communicate with the
database so it needs the Java Database Connectivity drivers. There are four
types of JDBC Drivers, they are as follows;
a) Type 1 [JDBC-ODBC Bridge Driver]:
JDBC-ODBC Bridge Driver converts the Java calls to
ODBC (Open Database Connectivity) calls and ODBC to DB (Database) Specific
calls. And in the similar way the, DB (Database) Specific calls are also
converted to ODBC calls and JDBC-ODBC Brigde driver converts it to Java calls. In
this way JDBC-ODBC Bridge Driver is used to make the communication between the
Java Application and Database. From the given figure above you can interpret in
your own ways.
Advantages:
.No need to search for drivers in the internet, it
is already installed.
.Works with any database.
Disadvantages:
.Works only in windows.
.Slow in communication.
b) Type 2 [Native API Driver]:
It uses the client-side libraries of the databse. It
converts JDBC method calls into native calls of database API. Also in similar
way, Native API Driver converts the DB specific calls to the JDBC Specific
calls. It is not entirely written in Java.
Advantages:
.Faster than Type 1
.Can be used in all platform but has separate
versions.
Disadvantages:
.You have to download it separately.
.Database Dependent.
c) Type 3 [Network Protocol Driver]:
Network Protocol Driver (NPD) convertes JDBC API
method calls to Middleware Application Server (MAS) and Middleware Application
Server (MAS) to Database (DB) specific calls. Also, the Middleware Application
Server Converts the DB (Database) Specific calls to Network Protocol Driver and
Network Protocol Driver to JDBC Specific calls.
Advantages:
.Purely Written in Java
.Works with any database.
Disadvantages:
.Economically not feasible.
.Slower in communication.
d) Type 4 [Native Protocol Driver]:
It directly interact with database. It does not
require any native database library. It is not purely written in Java.
Advantages:
.Faster Connection.
.Works in any platform.
Disadvantages:
.Database Dependent.
**************
Previous Lessons;
How to execute SQL in Java?
Java Database Connectivity(JDBC)
AWT Menu Based Application
AWT CheckBox and RadioButton
AWT Choice and List
Creating Menu Based Application Using Swing
JTable in Java
How to execute SQL in Java?
Java Database Connectivity(JDBC)
AWT Menu Based Application
AWT CheckBox and RadioButton
AWT Choice and List
Creating Menu Based Application Using Swing
JTable in Java
0 Comments