Supported drivers for JDBC and SQLJ
The Db2® product includes support for two types of JDBC driver architecture.
- 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 that 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.
Driver name | Packaged as | Driver type |
---|---|---|
IBM® Data Server Driver for JDBC and SQLJ |
|
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.
- 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).