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:
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:
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
Discussion & Comments