JDBC-ODBC-Bridge Driver | JDBC Tutorials

This  JDBC Tutorials “JDBC-ODBC” driver post is providing clear information about sun driver and use of JDBC driver in Java database connectivity.


 

What is JDBC driver?

  • Driver is nothing but a translator between Java Application and DBMS Application.
  • Java language specifications not understandable by DBMS(ORACLE).
  • Hence an interface(with implementation) is required to translate the instructions between Java and Oracle for communication.
  • The JDBC API defines the Java interfaces and classes that programmers use to connect to databases and send queries.
  • A JDBC driver (third party vendors provides) implements these interfaces and classes for a particular DBMS vendor.
  • A Java program that uses the JDBC API loads the specified driver for a particular DBMS before it actually connects to a database.
  • The JDBC DriverManager class then sends all JDBC API calls to the loaded driver.

 

JDBC-ODBC Bridge Driver(Type 1):

  • The JDBC-ODBC Bridge allows applications written in the Java programming language to use the JDBC API with many existing ODBC drivers.
  • Translates JDBC API calls into Microsoft Open Database Connectivity (ODBC) calls that are then passed to the ODBC driver.
  • The Driver implementation class provided by Sun Micro Systems.
  • Sun driver is available in the package sun.jdbc.odbc.JdbcOdbcDriver.
  • In a Type 1 driver, a JDBC bridge is used to access ODBC drivers installed on each client machine.
  • Using ODBC requires configuring on your system a Data Source Name (DSN) that represents the target database.
  • When Java first came out, this was a useful driver because most databases only supported ODBC access but now this type of driver is recommended only for experimental use or when no other alternative is available.
  • The ODBC binary code must be loaded on every client computer that uses this type of driver.

 

Advantages:

  • Connect to almost any database on any system, for which ODBC driver is installed.
  • Its an easy for installation as well as easy (simplest) to use as compare the all other driver.

 

Dis-advantages:

  • The ODBC Driver needs to be installed on the client machine.
  • It’s not a purely platform independent because its use ODBC which is depends on native libraries of the operating system on client machine.

Share this