You are on page 1of 2

Difference B/w different JDBC drivers Type 1 driver: This driver called as JDBC-ODBC bridge.

The Java Statements converts to JDBC statements.JDBC statements calls ODBC by using JDBC-ODBC bridge. ODBC drivers convert into the requirements of databases. Java--->JDBC Statement-->JDBC-ODBC bridge-->ODBC-->Databases. Type 2 driver: This driver is called as Native Driver where it requires the some native code to connect to the databases. Type 3 Driver: This driver is called as Protocal driver where Java-->JDBC statements-->SQLStatements--> databases. Type 4 Driver: This driver directly converts the java statements to SQL Statements which require to databases. It wont convert to JDBC statement. TYPE 1(JDBC-ODBC Bridge)
This driver called as JDBC-ODBC bridge. The Java Statements converts to JDBC statements. JDBC statements calls ODBC by using JDBC-ODBC bridge. ODBC drivers convert into the requirements of databases. Java--->JDBC Statement>JDBCODBC bridge->ODBC->Databases.

TYPE 2 (NativeAPI/partly Java driver)


This driver is called as Native Driver where it requires the some native code to connect to the databases.

TYPE 3(Netprotocol/all-Java driver)


This driver is called as Protocol driver where Java-->JDBC statements-->SQL Statements--> databases.

TYPE 4(Pure Java Driver)


This driver directly converts the java statements to SQL Statements which require to databases. It wont convert to JDBC statement.

The type 1 driver, JDBC-ODBC Bridge, translates all JDBC calls into ODBC (Open DataBase Connectivity) calls

JDBC driver type 2 -the native-API/partly Java driver -converts JDBC calls into databasespecific calls for

JDBC driver type 3 -the net-protocol/allJava driver -- follows a three-tiered approach whereby

Type 4 JDBC drivers are direct-todatabase pure Java drivers ("thin" drivers). A Type 4 driver takes JDBC

and sends them to the ODBC driver. As such, the ODBC driver, as well as, in many cases, the client database code, must be present on the client machine.

databases such as SQL Server, Informix, Oracle, or Sybase. The type 2 driver communicates directly with the database server; therefore it requires that some binary code be present on the client machine.

the JDBC database requests are passed through the network to the middle-tier server. The middle-tier server then translates the request (directly or indirectly) to the database-specific native-connectivity interface to further the request to the database server. If the middle-tier server is written in Java, it can use a type 1 or type 2 JDBC driver to do this.

calls and translates them into the network protocol (proprietary protocol) used directly by the DBMS. Thus, client machines or application servers can make direct calls to the DBMS server. Each DBMS requires its own Type 4 driver; therefore, there are more drivers to manage in a heterogeneous computing environment, but this is outweighed by the fact that Type 4 drivers provide faster performance and direct access to DBMS features.

SQL for practice: http://a4academics.com/interview-questions/53-database-and-sql/397-top-100-database-sql-interview-questionsand-answers-examples-queries

You might also like