Which JDBC driver Type(s) can be used in either applet or servlet code?
-
Both Type 1 and Type 2
-
Both Type 1 and Type 3
-
Both Type 3 and Type 4
-
Type 4 only
C
Correct answer
Explanation
JDBC driver Type 3 and Type 4 are pure Java drivers that can be used in either applet or servlet code. Type 3 is a net-protocol driver that converts JDBC calls to a database-independent protocol, while Type 4 is a native-protocol pure Java driver. Type 1 (JDBC-ODBC bridge) and Type 2 (native API partly Java) require native libraries and are platform-dependent, making them unsuitable for applets.