DB2 Version 9.7 for Linux, UNIX, and Windows

Supported drivers for JDBC and SQLJ

The DB2® product includes support for two types of JDBC driver architecture.

According to the JDBC specification, there are four types of JDBC driver architectures:
Type 1
Drivers that implement the JDBC API as a mapping to another data access API, such as Open Database Connectivity (ODBC). Drivers of this type are generally dependent on a native library, which limits their portability. The DB2 database system does not provide a type 1 driver.
Type 2
Drivers that are written partly in the Java™ programming language and partly in native code. The drivers use a native client library specific to the data source to which they connect. Because of the native code, their portability is limited.
Type 3
Drivers that use a pure Java client and communicate with a data server using a data-server-independent protocol. The data server then communicates the client's requests to the data source. The DB2 database system does not provide a type 3 driver.
Type 4
Drivers that are pure Java and implement the network protocol for a specific data source. The client connects directly to the data source.
DB2 Database for Linux, UNIX, and Windows supports the following drivers:
Driver name Packaged as Driver type
DB2 JDBC Type 2 Driver for Linux, UNIX and Windows db2java.zip Type 2
IBM® Data Server Driver for JDBC and SQLJ
  • db2jcc.jar and sqlj.zip for JDBC 3.0 support
  • db2jcc4.jar and sqlj4.zip for support of some JDBC 4.0 or later functions
Type 2 and Type 4

IBM Data Server Driver for JDBC and SQLJ (type 2 and type 4)

The IBM Data Server Driver for JDBC and SQLJ is a single driver that includes JDBC type 2 and JDBC type 4 behavior. When an application loads the IBM Data Server Driver for JDBC and SQLJ, a single driver instance is loaded for type 2 and type 4 implementations. The application can make type 2 and type 4 connections using this single driver instance. The type 2 and type 4 connections can be made concurrently. IBM Data Server Driver for JDBC and SQLJ type 2 driver behavior is referred to as IBM Data Server Driver for JDBC and SQLJ type 2 connectivity. IBM Data Server Driver for JDBC and SQLJ type 4 driver behavior is referred to as IBM Data Server Driver for JDBC and SQLJ type 4 connectivity.

Two versions of the IBM Data Server Driver for JDBC and SQLJ are available. IBM Data Server Driver for JDBC and SQLJ version 3.5x is JDBC 3.0-compliant. IBM Data Server Driver for JDBC and SQLJ version 4.x is compliant with JDBC 4.0 or later.

The IBM Data Server Driver for JDBC and SQLJ supports these JDBC and SQLJ functions:
  • Version 3.5x supports all of the methods that are described in the JDBC 3.0 specifications.
  • Version 4.x supports all of the methods that are described in the JDBC 4.0 or later specifications.
  • SQLJ application programming interfaces, as defined by the SQLJ standards, for simplified data access from Java applications.
  • Connections that are enabled for connection pooling. WebSphere® Application Server or another application server does the connection pooling.
  • Connections to a data server from Java user-defined functions and stored procedures use IBM Data Server Driver for JDBC and SQLJ type 2 connectivity only. Applications that call user-defined functions or stored procedures can use IBM Data Server Driver for JDBC and SQLJ type 2 connectivity or IBM Data Server Driver for JDBC and SQLJ type 4 connectivity to connect to a data server.

    The IBM Data Server Driver for JDBC and SQLJ is the default driver for Java routines.

  • Support for distributed transaction management. This support implements the Java 2 Platform, Enterprise Edition (J2EE) Java Transaction Service (JTS) and Java Transaction API (JTA) specifications, which conform to the X/Open standard for distributed transactions (Distributed Transaction Processing: The XA Specification, available from http://www.opengroup.org).

DB2 JDBC Type 2 Driver for Linux, UNIX and Windows (DB2 JDBC type 2 driver) (deprecated)

The DB2 JDBC type 2 driver lets Java applications make calls to DB2 through JDBC. Calls to the DB2 JDBC type 2 driver are implemented with Java native methods. The DB2 JDBC Type 2 Driver uses the DB2 CLI interface to communicate with DB2 data servers. The Java applications that use this driver must run on a DB2 client, through which JDBC requests flow to the DB2 data server. DB2 Connect™ must be installed before the DB2 JDBC application driver can be used to access DB2 for i data sources or data sources in the DB2 for z/OS® environments.

The DB2 JDBC type 2 driver supports these JDBC and SQLJ functions:
  • Most of the methods that are described in the JDBC 1.2 specification, and some of the methods that are described in the JDBC 2.0 specification.
  • SQLJ statements that perform equivalent operations to all JDBC methods
  • Connection pooling
  • Distributed transactions
  • Java user-defined functions and stored procedures

The DB2 JDBC Type 2 Driver for Linux, UNIX and Windows will not be supported in future releases. You should therefore consider moving to the IBM Data Server Driver for JDBC and SQLJ.