Configuring a JVM server to support Db2

A JVM server is the runtime environment for Java applications. You can configure the JVM server to support JDBC and SQLJ-based applications.

Before you begin

To use the JVM server with DB2®, it is best practice to install the latest version of the IBM® Data Server Driver for JDBC and SQLJ. You must add the Db2 SDSNLOD2 library to the CICS STEPLIB concatenation. For more information about required APARs, see Detailed system requirements.

About this task

Enable your applications to use the IBM® Data Server Driver for JDBC and SQLJ that is supplied with Db2 with the following steps.

Procedure

  1. To set up the driver for a Liberty JVM server, see Configuring a Liberty JVM server. For an OSGi JVM server, see Configuring a JVM server for OSGi applications.
  2. The Db2 environment variable DB2SQLJPROPERTIES is not supported in a JVM server, instead, you should set properties related to the Db2 driver directly in your JVM profile. For a list of available properties, see Programming for Db2 for z/OS in Db2 for z/OS product documentation.
  3. Optional: If you want to generate Db2 trace for a JVMSERVER, the following JVM profile properties are useful:
    -Ddb2.jcc.traceDirectory=/u/<userID>/db2trace/
    -Ddb2.jcc.traceFile=jccTrace.txt
    -Ddb2.jcc.appendFile=true 
    -Ddb2.jcc.traceLevel=-1

What to do next

If you want to use JDBC or SQLJ from a Java application in an OSGi JVM server with a Java 2 security policy mechanism active, see Enabling a Java security manager.