Difficulty: Easy
Correct Answer: Valid (Type 2 uses a native DBMS API accessed from Java)
Explanation:
Introduction / Context: Knowing the differences among JDBC driver types helps diagnose classpath/native library issues and informs deployment strategies. Type 2 drivers are distinct because they rely on native client libraries provided by the DBMS vendor.
Given Data / Assumptions:
Concept / Approach: Type 2 drivers are part Java and part native code; they call a DBMS’s native client API (for example, Oracle OCI). This requires installing the vendor’s client libraries on the host. In contrast, Type 4 drivers are pure Java and speak the database wire protocol directly. Thus, the statement about Type 2 is correct.
Step-by-Step Solution:
Identify that Type 2 requires vendor native libraries.Map consequence: environment must ship matching native binaries.Contrast with Type 4 which avoids native dependencies.Conclude the claim is valid.Verification / Alternative check: Attempt to load a Type 2 driver without native libs results in UnsatisfiedLinkError; installing the vendor client resolves it.
Why Other Options Are Wrong:
Common Pitfalls: Packaging apps without required native libraries; confusing Type 2 with the deprecated Type 1 bridge.
Final Answer: Valid (Type 2 uses a native DBMS API accessed from Java)
Discussion & Comments