Difficulty: Easy
Correct Answer: Both Type 3 and Type 4
Explanation:
Introduction:
JDBC drivers come in different architectures, each with implications for deployment in browsers (applets) and servers (servlets). Understanding which types are pure Java and do not require native libraries or local ODBC layers is vital for portability and security in both environments.
Given Data / Assumptions:
Concept / Approach:
Type 3 (network protocol) drivers communicate via a middleware server, and Type 4 (thin) drivers talk directly to the DBMS using the database’s wire protocol. Both are written in Java and avoid native dependencies, making them suitable for both applet and servlet contexts. Type 1 relies on ODBC; Type 2 uses native APIs, both unsuitable for applet security sandboxes and less portable in general.
Step-by-Step Solution:
1) Eliminate Type 1 (requires client-side ODBC) and Type 2 (requires native libraries).2) Confirm Type 3 is pure Java with middleware; Type 4 is pure Java with direct protocol.3) Conclude that both Type 3 and Type 4 fit applet and servlet usage.
Verification / Alternative check:
Vendor documentation and Java textbooks traditionally recommend Type 3 or Type 4 for browser and server environments due to their portability and ease of deployment.
Why Other Options Are Wrong:
Common Pitfalls:
Forgetting that applet sandboxes prohibit native libraries, ruling out Types 1 and 2.
Final Answer:
Both Type 3 and Type 4
Discussion & Comments