50 DB2 Nuggets #32 : Resource Info - Comparing JDBC Type 4 and type 2 connections
gorddbds 060001JCXS Visits (3067)
The current JDBC driver shipped with DB2 called the IBM CLIENT DRIVER FOR JDBC AND SQLJ can function as both a JDBC Type 4 and JDBC type 2 driver.
Type 4 Mode
When functioning as a JDBC type 4 driver, the driver is independent of the DB2 Client and only the driver jar db2jcc.jar or db2jcc4.jar need be installed. In this mode all TCP/IP command execution and routing is done through Java. In type 4 mode the driver requires the TCP/IP name and port of the server and uses the name of the database alias at the server. If a Z/OS DB2 location rather than a database name is used, the database name must be specified in all capitals. In type 4 mode the driver uses its own client reroute, Sysplex and connection concentrator mechanisms.
Type 2 Mode
In type 2 mode the driver is dependent on the DB2 Client to establish connections via OS API calls to TCP/IP and it is necessary to have the DB2 client location in the library path. In this mode the entries in the local client DB2 catalogs are used and only the database name is required. The database name specified must be the database alias from the local client catalogs if this name differs from the one on the database server. It is not necessary to specify the name in all capitals if the destination is a Z/OS DB2 location rather than a database name. In type 2 mode, the DB2 client reroute and Sysplex mechanisms are used and client side connection concentration is not available.