JDBC Driver Types

There are four distinct types of JDBC drivers:

  • Type1 - JDBC-ODBC Bridge Driver (Bridge)
  • Type2 - Native API Java Driver (Native)
  • Type3 - Java to Network Protocol Driver (Middleware)
  • Type4 - Pure Java Driver (Pure)

Type1 - JDBC-ODBC Bridge Driver

  • Type1 driver act as a bridge between Java application and database connectivity mechanism like ODBC
  • The bridge provides JDBC access using most standard ODBC drivers
  • This driver is included in the Java2 SDK(Software Develiopment Kit) in the sun.jdbc.odbc package
  • JDBC statements call the ODBC by using the JDBC - ODBC Bridge and finally the query is executed by the database
  • Only limitation is performance overhead since the calls have to go through the JDBC overhead bridge to the ODBC driver
  • It works only with Micrsosoft Operating Systems

Develop JDBC Application using Type1 driver

Type2 - Native API Java Driver

  • Use the Java Native Interface (JNI) to make calls to a local database library
  • Converts JDBC calls into a database specific call for databases such as MySQL,MS-SQL Server or ORACLE etc.
  • Communicates directly with the database server & requires some native code to connect to the database
  • The vendor client library needs to be installed on the client machine. So it cannot be used in internet due the client side software needed

Type3 - Java to Network Protocol Driver

  • Pure Java drivers that use a proprietary network protocol to communicate with JDBC middleware on the server
  • The middleware then translates the network protocol to database-specific function calls
  • Do not require native database libraries in the client side and can connect to many different databases in the backend
  • Can be deployed over the Internet without client installation
  • Requires database-specific coding to be done in the middle tier. An extra layer added may result in a time-bottleneck.
  • Typically this is overcome by providing efficient middleware services

Type4 - Pure Java Driver

  • Pure Java drivers that implement a proprietary database protocol to communicate directly with the database
  • Like Type3 driver, they do not require native database libraries and can be deployed over the Internet without any installation in the client side
  • One drawback is that they are database specific
  • Communicate directly with the database engine rather than through middleware or a native library
  • Usually the fastest JDBC drivers available
  • Directly converts java statements to SQL statements

Develop JDBC Application using Type4 driver

Previous Next

Share your valuable comment

Name :
Email Id : [ We will not publish your email id ]
Your Comment : [ Maximum 200 chars ]
Enter Security code :

Comment by : kamal November 4th, 2013
Comment : Simple and Superb... If you have used some architecture diagram...It would be more accurate...

Comment by : ankita July 19th, 2013
Comment : good for referrence................................ short and straigth to point................. diagrams should be included................. thank you