What is the difference between a Type 2 and a Type 4 connection for DB2

Technote (troubleshooting)


What is the difference between a Type 2 and a Type 4 connection for DB2?

Resolving the problem

This difference between Type 2 and Type 4 is seen when you create the Data Source in Composite.

The latest Java programming specification is defined by Java 2 Platform Enterprise Edition (J2EE) 1.4, which requires a JDBC 3.0-compliant driver to access RDBMSs from various Java-based program modules. Using new JDBC 3.0 programming interfaces requires a Java Development Kit 1.4 environment. These modules may exist on client workstations or within an application server.

The DB2 Universal JDBC driver includes support for Type 4 and Type 2 mode connections. Choosing a DB2 JDBC connection mode requires an analysis of your development and operational environment. Most users prefer a Type 4 driver because it can be included with the application and doesn't depend on shared libraries. Type 2 drivers always require a shared library because communication between the driver and the server is handled in the driver's non-Java component. A quick rule of thumb would be to use Type 4 for remote access to the database over TCP/IP; use Type 2 if you're on the same logical operating system image as the DB2 server (IPC)or within a Java stored procedure (which can't use TCP/IP to access DB2).

Type 2: Requires the DB2 Client is also installed on the same server as the JDBC driver because the driver is simply a front-end to the DB2 Client. It points to the alias you configured on the Client for your database, similar to an ODBC driver.

Type 4: Connects to the database on server directly via the hostname/port.

Composite allows you to use one or the other.

Cross reference information
Segment Product Component Platform Version Edition
Business Analytics Cognos 8 Business Intelligence Composite Information Server

Historical Number


Document information

More support for:

Cognos ReportNet

Software version:

Cognos ReportNet 1.1MR2, Composite Information Server 8.2

Operating system(s):


Reference #:


Modified date:


Translate my page

Content navigation