JDBC Drivers Presentation Updated-1
JDBC Drivers Presentation Updated-1
Types
• Comparing Type 1 to Type 4 Drivers
• Prepared by: Shashank Katwe
Type 1 Driver (JDBC-ODBC Bridge)
• Definition:
• - Type-1 driver, or JDBC-ODBC bridge driver, uses the ODBC driver to connect to the
database.
• - Converts JDBC method calls into ODBC function calls.
• Also Known As: Universal driver (connects to any database).
• Note: Discouraged now due to the thin driver; unsupported by Oracle from Java 8.
Type 1 Driver - Pros & Cons
• Advantages:
• - Easy to use and universally compatible with databases.
• Disadvantages:
• - Performance loss due to JDBC-to-ODBC call conversion.
• - Requires ODBC driver and client library installation on the client machine.
Type 2 Driver (Native-API)
• Definition:
• - Type-2 driver, or Native-API driver, partially written in Java.
• - Utilizes the client-side libraries of the database to convert JDBC calls into native
database API calls.
Type 2 Driver - Pros & Cons
• Advantages:
• - Improved performance compared to the JDBC-ODBC bridge.
• Disadvantages:
• - Native driver and vendor library installation required on each client machine.
Type 3 Driver (Network Protocol)
• Definition:
• - Network Protocol driver, fully Java-based.
• - Uses middleware (application server) that converts JDBC calls into a vendor-specific
database protocol.
Type 3 Driver - Pros & Cons
• Advantages:
• - No client-side library needed; middleware adds features like auditing and load
balancing.
• Disadvantages:
• - Requires network support; costly maintenance due to database-specific coding.
Type 4 Driver (Thin Driver)
• Definition:
• - Type-4, or Thin driver, fully written in Java.
• - Directly converts JDBC calls into a vendor-specific database protocol.
Type 4 Driver - Pros & Cons
• Advantages:
• - Highest performance; no client-side or server-side software required.
• Disadvantages:
• - Driver is database-dependent.