Supported drivers for JDBC and SQLJ
The IBM® Data Server Driver for JDBC and SQLJ product includes support for two types of JDBC driver architecture. However not all data servers support both types.
- 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.
- 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.
- 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.
- db2jcc.jar and sqlj.zip for JDBC 3.0 and earlier support
- db2jcc4.jar and sqlj4.zip for JDBC 4.0 or later, and JDBC 3.0 or earlier support
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.xx is JDBC 3.0-compliant. IBM Data Server Driver for JDBC and SQLJ version 4.xx is compliant with JDBC 4.0 or later.
- Version 3.xx supports all of the methods that are described in the JDBC 3.0 specifications.
- Version 4.xx 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.
- 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) (IBM Data Server Driver for JDBC and SQLJ type 4 connectivity to DB2 for z/OS environment, Version 7 or later, or to Db2 on Linux, UNIX, and Windows systems).
In general, you should use IBM Data Server Driver for JDBC and SQLJ type 2 connectivity for Java programs that run on the same z/OS system or IBM Z logical partition (LPAR) as the target DB2 subsystem. Use IBM Data Server Driver for JDBC and SQLJ type 4 connectivity for Java programs that run on a different z/OS system or LPAR from the target DB2 subsystem.
For z/OS systems or LPARs that do not have DB2 for z/OS, the z/OS Application Connectivity to DB2 for z/OS optional feature can be installed to provide IBM Data Server Driver for JDBC and SQLJ type 4 connectivity to a Db2 on Linux, UNIX, and Windows systems data server.
To use the IBM Data Server Driver for JDBC and SQLJ, you need Java 2 Technology Edition, V5 or later.