JDBC Driver Types

JDBC Driver Types:

Why Should We Use JDBC?
  • Before JDBC, ODBC API was used to connect and execute the query with the database. 
  • The ODBC API used an ODBC driver which is written in C language (platform-dependent and unsecured). 
  • Java has defined its own API (JDBC API) that uses JDBC drivers (written in Java language).
There are four types of JDBC drivers:

JDBC-ODBC Bridge Driver
  • It is used ODBC driver to connect to the database.
  • ODBC stands for Open Data Base Connectivity
  • The JDBC-ODBC bridge driver mapping JDBC method calls into the ODBC methods calls
  • Note
    • In Java 8, the JDBC-ODBC Bridge has been removed.
    • Oracle does not support the JDBC-ODBC Bridge from Java 8. 
  • Advantages:
    • Easy to understand.
    • Easy to connect with database.
  • Disadvantages:
    • Performance degraded because mapping process.
    • The client machine needs to install ODBC driver.
Native Driver
  • It is used the client-side libraries of the database. 
  • The driver mapping JDBC method calls into native calls.
  • It is partially written in java.
  • Advantage:
    • It is good compared to JDBC-ODBC bridge driver.
  • Disadvantage:
    • The client machine needs to install Native driver.
Network Protocol Driver
  • It is used middleware.
  • The middleware server mapping JDBC calls directly or indirectly into the vendor-specific database protocol.
  • It is entirely written in java.
  • Advantage:
    • No client-side library is required.
    • The middleware server that can perform many tasks like auditing, load balancing, logging etc.
  • Disadvantages:
    • Network support is required on the client machine.
    • Requires database-specific coding to be done in the middleware server.
    • Maintenance becomes costly because it needs database-specific coding in the middleware server.
Thin Driver
  • This driver mapping JDBC calls directly into the vendor-specific driver. 
  • It is entirely written in Java.
  • Advantage:
    • Better performance than all other drivers.
    • No software is required at client side or server side.
  • Disadvantage:
    • Drivers depend on the Database.

Thanks a lot for query or your valuable suggestions related to the topic.

Previous Post Next Post

Contact Form