JDBC-ODBC bridge identification: Which JDBC driver Type corresponds to the historical JDBC-ODBC bridge (now obsolete and removed from modern JDKs)?

Difficulty: Easy

Correct Answer: Type 1

Explanation:


Introduction / Context:
The JDBC-ODBC bridge was an early solution for connecting Java applications to databases through the ODBC layer. Although it simplified initial adoption, it imposed native dependencies and has been deprecated and removed in modern Java distributions.



Given Data / Assumptions:

  • We are mapping the bridge to a JDBC Type number.
  • Type 1 drivers rely on ODBC and native libraries.
  • Type 4 drivers are the modern, pure-Java norm.


Concept / Approach:

Type 1 is explicitly defined as the JDBC-ODBC bridge. It translates JDBC calls to ODBC calls, which are then handled by the ODBC driver for the target database. This approach requires native DLLs/so files and is not suitable for portable, containerized deployments.



Step-by-Step Solution:

Recall the four Types and their definitions.Identify the one that uses ODBC: Type 1.Select Type 1 as the correct answer.


Verification / Alternative check:

Review JDK documentation: the JDBC-ODBC bridge (sun.jdbc.odbc.JdbcOdbcDriver) was removed after Java 8 and is clearly described as Type 1.



Why Other Options Are Wrong:

Type 2 uses native DB APIs but not ODBC specifically.

Type 3 and Type 4 are pure Java network drivers.



Common Pitfalls:

Attempting to use the bridge in modern JDKs; mixing up Type 2 (native API) with the ODBC bridge.



Final Answer:

Type 1

More Questions from JDBC, Java Server Pages, and MySQL

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion