IBM Db2 driver for JDBC and SQLJ support in IBM Content Manager

IBM Content Manager supports only the IBM Db2® Driver for JDBC and SQLJ (type 2 and type 4). This driver is sometimes referred to as the JCC JDBC driver. This driver requirement affects the IBM Content Manager connector.

The type 4 driver is a pure Java™ driver, which means that the application requires only the JAR files and does not require the Db2 Runtime Client. However, in this mode, when the IBM Content Manager application uses the JDBC driver, you must explicitly specify the host name and the port of the database that is being connected to. Specifying the host name and port eliminates the need to use the database catalog. However, if the host name, port, or the remote database are not specified in the cmbicmsrvs.ini file for IBM Content Manager connector, the type 2 connection is used by default. The type 2 connection requires the Db2 Runtime Client and a database cataloged on the local system.

If the host name, port, and the remote database name are specified, but the values are incorrect, an error results when IBM Content Manager attempts to make a type 4 connection, for example: DGL0394A: Error in::DriverManager.getConnection; [jcc][10389][12245][3.50.152] Failure in loading native library db2jcct2

To correct this error, you must update the INI file to include the correct information.

Important: IBM Content Manager requires a dynamic library (db2jcct2.dll on Windows® or libdb2jcct2.so on Linux®) to use a JDBC type 2 driver.
Windows™
Add the path that includes the db2jcct2.dll file to the PATH variable. By default, the db2jcct2.dll file is located in %DB2HOME%\bin. directory.
Linux®
IBM Content Manager loads the libdb2jcct2.so file from Db2 instance library path defined in LD_LIBRARY_PATH or LIBPATH variable.
Db2 instance
Db2 instance library path must exist in LD_LIBRARY_PATH (Linux) or LIBPATH (AIX®).
Linux
 export LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib:$LD_LIBRARY_PATH
AIX®
export LIBPATH=/home/db2inst1/sqllib/lib:$LIBPATH
The [DB2 Instance Dir]/sqllib/lib path links to the 64-bit library directory. The link relationship of the Db2 library directory on Linux is:
[DB2 Instance Dir]/sqllib/lib -> 
[DB2 Instance Dir]/sqllib/lib64 -> 
[DB2 Product Installation Dir]/lib64
[DB2 Instance Dir]/sqllib/lib32 -> [DB2 Product Installation Dir]/lib32

If a 32-bit JVM is used to run the Java IBM Content Manager application and the type 2 connection is configured, then the path to 32-bit libraries must be listed before the path to the 64-bit libraries in LD_LIBRARY_PATH or LIBPATH. For example, on AIX:

export LIBPATH=/opt/IBM/db2/V9.7/lib32:$LIBPATH

The JAR file that is required for IBM Db2 Driver for JDBC and SQLJ (type 2 and type 4) is:

db2jcc4.jar

This JAR file is packaged with IBM Content Manager.

An additional JAR file, db2jcc_license_cisuz.jar is required to connect to zSeries servers. The db2jcc_license_cisuz.jar is also packaged with IBM Content Manager.

Important: Before IBM Content Manager V8.5, the JDBC 3.0 driver was supported for use with IBM Db2 databases. This driver is in the db2jcc.jar file. Although the db2jcc.jar file is not fully supported by IBM Content Manager V8.6, it can be used with some associated custom applications. It allows the applications to continue to run after an upgrade of IBM Content Manager to V8.6. This condition is limited to applications that are not compatible with the new JDBC 4.0 drivers. For most applications, a JDBC 4.0 driver should work as expected after a classpath update. The old JDBC 3.0 db2jcc.jar file is not packaged with IBM Content Manager V8.6. Instead, it must be downloaded from the IBM Db2 support website.

Modifications to cmbicmsrvs.ini file

The existing cmbicmsrvs.ini file for the IBM Content Manager connector supports IBM Db2 Driver for JDBC and SQLJ.

IBM Content Manager also allows you to override the host name, port, and remote database name values by specifying the JDBC driver and JDBC URL directly. To specify the JDBC driver and the JDBC URL directly, IBM Content Manager provides two properties, ICMJDBCDRIVER and ICMJDBCURL in the cmbicmsrvs.ini file for IBM Content Manager connector. You can also provide the JDBCURL and JDBCDRIVER properties by using the connect_string parameter associated with the DKDatastoreICM::connect method.

In IBM Content Manager, these properties are optional and do not have any values. You can specify the values of these properties by choosing either of the following ways:

  • If the ICMJDBCDRIVER property is not specified or is empty, the IBM Db2 Driver for JDBC and SQLJ (type 2 and type 4) driver is used by default. The new IBM Db2 Driver for JDBC and SQLJ (type 2 and type 4) driver is loaded through the com.ibm.db2.jcc.DB2Driver class.
  • If the ICMJDBCURL property is specified and the ICMHOST, ICMPORT, and ICMREMOTEDB information is also specified in the cmbicmsrvs.ini file, the value associated with the ICMJDBCURL property takes precedence and is used as the URL to connect to the database.
  • If the JDBCURL property is specified by using the connect_string parameter of the connect() method and the ICMJDBCURL property is specified in cmbicmsrvs.ini file, the JDBCURL property in the connect_string parameter takes precedence. Similarly, the JDBCDRIVER property passed through the connect_string parameter takes precedence over the ICMJDBCDRIVER property specified in cmbicmsrvs.ini file.

Setting both the URL and the driver is not a requirement. You might specify either the URL or the driver.

To specify a driver other than the IBM Db2 Driver for JDBC and SQLJ, the values for the ICMJDBCDRIVER and ICMJDBCURL properties must be manually set in the cmbicmsrvs.ini file. IBM Content Manager supports only the IBM Db2 Driver for JDBC and SQLJ when connecting to a Db2 database. IBM Content Manager does not support any other driver for a Db2 database.

You can set the values for the ICMJDBCDRIVER and ICMJDBCURL properties in the INI file:

ICMJDBCDRIVER=com.ibm.db2.jcc.DB2Driver 
ICMJDBCURL=jdbc:db2://myhostname.ibm.com:50000/icmnlsdb
Remember:

When an IP address is used instead of a host name in the JDBC URL, square brackets ([ and ]) must enclose the IP address if IPv6 is used. For example, the connect string for IPv6 address 2007::9:181:141:150 must be entered in the following format:

JDBCURL=jdbc:db2://[2007::9:181:141:150]:50000/icmnlsdb
Important: The INI file properties and the connect_string parameter applies to Db2. The INI file properties and the connect_string parameter also applies to Oracle.