Appendix A. Tricky connections 423
1. DB2 JDBC Type 1
A JDBC Type 1 driver is built into Java and basically provides a JDBC-ODBC
bridge. It is typically not used any more.
A JDBC Type 1 driver can be used by JDBC 1.2 JDBC 2.0, and JDBC 2.1.
2. DB2 JDBC Type 2
The DB2JDBC Type 2 driver is quite popular and is often referred to as the
app driver. The app driver name comes from the notion that this driver will
perform a native connect through a local DB2 client to a remote database,
and from its package name (COM.ibm.db2.jdbc.app.*).
In other words, you have to have a DB2 client installed on the machine where
the application that is making the JDBC calls runs. The JDBC Type 2 driver is
a combination of Java and native code, and will therefore always yield better
performance than a Java-only Type 3 or Type 4 implementation.
This driver's implementation uses a Java layer that is bound to the native
platform C libraries. Programmers using the J2EE™ programming model will
gravitate to the Type 2 driver as it provides top performance and complete
function. It is also certified for use on J2EE servers.
The implementation class name for this type of driver is
com.ibm.db2.jdbc.app.DB2Driver.
The JDBC Type 2 drivers can be used to support JDBC 1.2, JDBC 2.0, and
JDBC 2.1.
3. DB2 JDBC Type 3
The JDBC Type 3 driver is a pure Java implementation that must talk to
middleware that provides a DB2 JDBC Applet Server. This driver was
designed to enable Java applets to access DB2 data sources. An application
using this driver can talk to another machine where a DB2 client has been
installed.
The JDBC Type 3 driver is often referred to as the
net driver, appropriately
named after its package name (COM.ibm.db2.jdbc.net.*).
The implementation class name for this type of driver is
com.ibm.db2.jdbc.net.DB2Driver
The JDBC Type 3 driver can be used with JDBC 1.2, JDBC 2.0, and JDBC
2.1.
4. DB2 JDBC Type 4
The JDBC Type 4 driver is also a pure Java implementation. An application
using a JDBC Type 4 driver does not need to interface with a DB2 client for
connectivity because this driver comes with Distributed Relational Database