Difficulty: Easy
Correct Answer: Type 1 (JDBC–ODBC bridge driver)
Explanation:
Introduction / Context:
Java applications use Java Database Connectivity (JDBC) drivers to communicate with relational databases. The JDBC specification defines several driver types, each with a different way of talking to the underlying database system. One of the earliest approaches was the JDBC–ODBC bridge, which allowed Java programs to reuse existing Open Database Connectivity (ODBC) drivers. This question checks whether you remember which JDBC driver type number corresponds to that historical bridge driver.
Given Data / Assumptions:
Concept / Approach:
JDBC categorizes drivers into four types. Type 1 is the JDBC–ODBC bridge driver. Type 2 uses a mixture of Java and native APIs. Type 3 uses a network protocol and a middleware server. Type 4 is a pure Java driver that speaks the database native protocol directly. To answer the question, we simply need to recall which type number corresponds to the bridge based on ODBC.
Step-by-Step Solution:
Step 1: Recall that JDBC Type 1 driver uses an ODBC driver underneath to reach the database.Step 2: Recognize that this approach is known historically as the JDBC–ODBC bridge driver.Step 3: Map the JDBC–ODBC bridge to the correct driver type number in the official classification.Step 4: Confirm that Type 1 is defined as the JDBC–ODBC bridge driver and therefore is the correct answer.
Verification / Alternative check:
Another way to remember this is to associate the numbers with how modern each driver is. Type 4 drivers are the most modern and are written entirely in Java. Type 3 drivers use a middle tier. Type 2 drivers are partly native. The oldest style that depends on ODBC and native libraries is Type 1. Since the JDBC–ODBC bridge is considered legacy and is Type 1 in Java documentation, this confirms our choice.
Why Other Options Are Wrong:
Option A (Type 4): This is a pure Java driver that talks directly to the database native protocol and does not rely on ODBC.Option B (Type 3): This uses a database independent network protocol and a middleware server, not ODBC.Option D (Type 2): This is a native API partly Java driver that calls vendor specific libraries directly rather than going through ODBC.
Common Pitfalls:
Students often confuse Type 1 and Type 2 because both involve native code. The key difference is that Type 1 specifically routes calls through an ODBC driver, while Type 2 calls vendor native APIs directly. Another mistake is assuming that higher type numbers always indicate better performance. In reality, performance depends on implementation quality, but Type 1 is generally considered legacy and less efficient compared to modern pure Java Type 4 drivers.
Final Answer:
The correct answer is Type 1 (JDBC–ODBC bridge driver).
Discussion & Comments