What are the differences between type1 driver, type2 driver,type3 driver,type4 driver in jdbc

Showing Answers 1 - 12 of 12 Answers

suresh

  • Oct 11th, 2005
 

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--->JDBCStat-->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.

   

  Was this answer useful?  Yes

kadar shereef

  • Oct 24th, 2005
 

what are the differences between type1 driver, typ...

  Was this answer useful?  Yes

anil

  • Nov 6th, 2005
 

can u clarify the basic differences in drivers

  Was this answer useful?  Yes

anil

  • Nov 6th, 2005
 

can u clarify the basic differences in drivers

  Was this answer useful?  Yes

anil

  • Nov 6th, 2005
 

can u clarify the basic differences in drivers

  Was this answer useful?  Yes

vibin

  • Dec 1st, 2005
 

Type 1: JDBC-ODBC Bridge

The type 1 driver, JDBC-ODBC Bridge, translates all JDBC calls into ODBC (Open
DataBase Connectivity) calls 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.


Type 2: Native-API/partly Java driver

JDBC driver type 2 -- the native-API/partly Java driver -- converts JDBC
calls into database-specific calls for 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.


Type 3: Net-protocol/all-Java driver

JDBC driver type 3 -- the net-protocol/all-Java driver -- follows a
three-tiered approach whereby 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.


Type 4 Pure Java Driver

Type 4 JDBC drivers are direct-to-database pure Java drivers ("thin"
drivers). A Type 4 driver takes JDBC 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.


Thanks

_vibin D

  Was this answer useful?  Yes

sreekanth

  • Aug 23rd, 2007
 

1.A JDBC-ODBC bridge provides JDBC API access via one or more ODBC drivers. Note that some ODBC native code and in many cases native database client code must be loaded on each client machine that uses this type of driver. Hence, this kind of driver is generally most appropriate when automatic installation and downloading of a Java technology application is not important. For information on the JDBC-ODBC bridge driver provided by Sun, see JDBC-ODBC Bridge Driver2.A native-API partly Java technology-enabled driver converts JDBC calls into calls on the client API for Oracle, Sybase, Informix, DB2, or other DBMS. Note that, like the bridge driver, this style of driver requires that some binary code be loaded on each client machine. 3.A net-protocol fully Java technology-enabled driver translates JDBC API calls into a DBMS-independent net protocol which is then translated to a DBMS protocol by a server. This net server middleware is able to connect all of its Java technology-based clients to many different databases. The specific protocol used depends on the vendor. In general, this is the most flexible JDBC API alternative. It is likely that all vendors of this solution will provide products suitable for Intranet use. In order for these products to also support Internet access they must handle the additional requirements for security, access through firewalls, etc., that the Web imposes. Several vendors are adding JDBC technology-based drivers to their existing database middleware products. A native-protocol fully Java technology-enabled driver converts JDBC technology calls into the network protocol used by DBMSs directly. This allows a direct call from the client machine to the DBMS server and is a practical solution for Intranet access. Since many of these protocols are proprietary the database vendors themselves will be the primary source for this style of driver.

  Was this answer useful?  Yes

Novice

  • Sep 1st, 2007
 

Is the code for all the drivers same ?

Can someone give code sample of each type?

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions