Difficulty: Easy
Correct Answer: Both Type 3 and Type 4
Explanation:
Introduction / Context:
JDBC drivers are classified into four historical types based on how they translate JDBC calls to database-specific protocols. Understanding which types are intended for networked use helps developers pick drivers that work well in distributed applications, servlet containers, and microservices.
Given Data / Assumptions:
Concept / Approach:
Type 3 (network protocol driver) is a pure-Java driver that sends JDBC calls to a middleware server using a database-independent protocol; the middleware then translates to the database protocol. Type 4 (thin driver) is also pure Java and speaks the database’s native protocol directly to the database over the network. Both are built for networked environments and are common in app servers like Tomcat, JBoss, and Spring Boot deployments.
Step-by-Step Solution:
Verification / Alternative check:
Vendor documentation for widely used drivers (for example, PostgreSQL’s Type 4 driver, MySQL Connector/J) confirms direct TCP/IP connectivity without native libraries. Historical Type 3 products relied on middleware hubs reachable over the network.
Why Other Options Are Wrong:
Type 3 only / Type 4 only: incomplete; both are intended for networked operation.
Neither: contradicts the core purpose of Types 3 and 4.
Common Pitfalls:
Confusing Type numbers with performance guarantees; real-world performance depends on driver quality and database protocol, not just the Type. Also, Type 1 is obsolete and should not be used in production.
Final Answer:
Both Type 3 and Type 4
Discussion & Comments