JDBC Driver JDBC Driver is required to process SQL requests and generate result. The following are the different types of driver available in JDBC.    

Type-1 Driver or JDBC-ODBC bridge Type-2 Driver or Native API Partly Java Driver Type-3 Driver or Network Protocol Driver Type-4 Driver or Thin Driver

Type I Driver JDBC-ODBC bridge Type-1 Driver act as a bridge between JDBC and other database connectivity mechanism(ODBC). This driver converts JDBC calls into ODBC calls and redirects the request to the ODBC driver.

Advantage  

Easy to use Allow easy connectivity to all database supported by the ODBC Driver.

Disadvantage   

Slow execution time Dependent on ODBC Driver. Uses Java Native Interface(JNI) to make ODBC call.

Type 2 Driver - Native API Driver This type of driver make use of Java Native Interface(JNI) call on database specific native client API. These native client API are usually written in C and C++.

Advantage  

faster as compared to Type-1 Driver Contains additional features.

Disadvantage  

Requires native library Increased cost of Application

Type 3 Driver - Network Protocol Driver This driver translate the JDBC calls into a database server independent and Middleware serverspecific calls. Middleware server further translate JDBC calls into database specific calls.

Advantage



Does not require any native library to be installed on client. This driver is server-based, so there is no need for any vendor database library to be present on client machines.



This driver is fully written in Java and hence Portable. It is suitable for the web.



Database Independency.



Provide facility to switch over from one database to another database.

Disadvantage 

Slow due to increase number of network call.

Type 4 Driver - Thin Driver This driver interact directly with database. It does not require any native database library, that is why it is also known as Thin Driver. In a Type 4 driver, a pure Java-based driver communicates directly with the vendor's database through socket connection. This is the highest performance driver available for the database and is usually provided by the vendor itself. This kind of driver is extremely flexible, you don't need to install special software on the client or server. Further, these drivers can be downloaded dynamically.

Advantage 

Does not require any native library.



Does not require any Middleware server.



Better Performance than other driver.

Disadvantage 

Slow due to increase number of network call.

Which Driver should be Used? 

If you are accessing one type of database, such as Oracle, Sybase, or IBM, the preferred driver type is 4.



If your Java application is accessing multiple types of databases at the same time, type 3 is the preferred driver.



Type 2 drivers are useful in situations, where a type 3 or type 4 driver is not available yet for your database.



The type 1 driver is not considered a deployment-level driver, and is typically used for development and testing purposes only.

JDBC Driver.pdf

There was a problem previewing this document. Retrying... Download. Connect more apps... Try one of the apps below to open or edit this item. JDBC Driver.pdf.

218KB Sizes 2 Downloads 73 Views

Recommend Documents

types of jdbc drivers pdf
Page 1. Whoops! There was a problem loading more pages. types of jdbc drivers pdf. types of jdbc drivers pdf. Open. Extract. Open with. Sign In. Main menu.

Java JDBC CAI 25.04.2013.pdf
... its own API (JDBC API). that uses JDBC driver written in Java language. Page 3 of 45. Java JDBC CAI 25.04.2013.pdf. Java JDBC CAI 25.04.2013.pdf. Open.

An extensible, open source, ODBC and JDBC driver - GitHub
Dec 19, 2013 - Avatica remote JDBC driver. Java client. Avatica. RPC. Protocol. Avatica local JDBC driver. Java VM. Java app. Avatica SPI. Provider X. Client.