Types of JDBC drivers


 

Types of JDBC drivers

In this example the types of jdbc drivers are given and its types.

In this example the types of jdbc drivers are given and its types.
JDBC Driver's Type

JDBC Driver can be broadly categorized into 4 categories--

JDBC-ODBC BRIDGE DRIVER(TYPE 1) 

Features

1.Convert the query of JDBC Driver into the ODBC query, which in return pass the data.

2.JDBC-ODBC is native code not written in java.

3.The connection occurs as follows -- Client -> JDBC Driver -> ODBC Driver -> Database  .

jdbc-odbc bridge driver

Pros-->

A type-1 driver is easy to install and handle

Cons-->

1.Extra channels in between database and application made performance overhead.

2.Needs to be installed on client machine.

3.Not suitable for applet , due to the installation at clients end.

Native-API Type-2 Driver  

Features

The type 2 driver need libraries installed at client site. For example, we need "mysqlconnector.jar" to be copied in library of java kit. It is not written in java entirely because the non-java interface have the direct access to database.

Pros--

1.Type 2 driver has additional functionality and better performance than Type 1.

2.Has faster performance than type 1,3 &4,since it has separate code for native APIS.

Cons--

1.library needs to be installed on the client machine .

2.Due to the client side software demand, it can't be used for web based application.

3.platform dependent.

4.It doesn't support "Applets".

Network-Protocol Type 3 driver 

Features  

1.It has a 3-tier architecture.

2.It can interact with multiple database of different environment.

3.The JDBC Client driver written in java, communicates with a middleware-net-server using a database independent protocol, and then this net server translates this request into database commands for that database.

0

4.The connection occurs as follows--Client -> JDBC Driver -> Middleware-Net Server -> Any Database.

Pros-- 

1

1.The client driver to middleware communication is database independent.

2.Can be used in internet since there is no client side software needed.

Cons--

2

1.Needs specific coding for different database at middleware.

2.Due to extra layer in middle can result in time-delay.

Native Protocol Type 4 Driver

3

Features

Also known as Direct to Database Pure Java Driver .It is entirely in java. It interacts directly with database generally through socket connection. It is platform independent. It directly coverts driver calls into database protocol calls.

Pros--  

4

1.Improved performance because no intermediate translator like JDBC or middleware server.

2.All the connection is managed by JVM, so debugging is easier.

5

Ads