JDBC: Introduction

  • JDBC is a standard which is designed by Sun Micro Systems.
  • JDBC provides a standard library to access RDBMS (Relational Database Management System).
  • JDBC API allow  Java code to connect wide variety of data bases.

JDBC API supports 4 types of drivers. They are listed below
  1. JDBC-ODBC bridge driver:
  2. The JDBC-ODBC bridge driver uses ODBC driver to connect to the database. The JDBC-ODBC bridge driver converts JDBC method calls into the ODBC function calls. Now a days, In production, no one encourage to use this driver.
    Advantages:
    • It is easy to configure or connect database and use.
    Disadvantages:
    • Performance degraded because each JDBC method call is converted into the ODBC function calls.
    • The ODBC driver needs to be installed on the client machine.
  3. Native-API driver (partially java driver):
  4. The Native API driver uses the client-side libraries of the database. In this driver each JDBC method calls converts into native calls of the database API. It is partially written in java.
    Advantage:
    • performance upgraded than JDBC-ODBC bridge driver.
    Disadvantage:
    • Driver dependency. It means, The Native driver needs to be installed on the each client machine.
    • The Vendor client library needs to be installed on client machine..
  5. Network Protocol driver (fully java driver)
  6. The Network Protocol driver uses application server9Middleware). The Middleware layer converts each JDBC calls directly or indirectly into the vendor-specific database protocol. It is fully written in java.
    Advantage:
    • It is better performer than Native -API Driver.
    • No client side library is required because of application server that can perform many tasks like auditing, load balancing, logging etc.
    Disadvantages:
    • Network support is required on client machine.
    • Requires database-specific coding to be done in the middle tier.
    • Network Protocol driver requires database-specific coding to be done in the middle tier, So it expensive to maintain.
  7. Thin driver (fully java driver)
  8. The thin driver converts JDBC calls directly into the vendor-specific database protocol. That is why it is known as thin driver. It is fully written in Java language.
    Advantage:
    • Widely acceptable driver to connect database
    • Better performance than all other drivers.
No software is required at client side or server side. Disadvantage:
  • Independent driver implementation required for each database. It means, each database has it's own driver implementation.

The following picture describes JDBC Architecture

SHARE

    Blogger Comment
    Facebook Comment

0 comments :

Post a Comment