IBM Support

How to configure Db2Connect global/customized property for Java applications with WebSphere Application Server

Technical Blog Post


Abstract

How to configure Db2Connect global/customized property for Java applications with WebSphere Application Server

Body

How to configure Db2Connect global/customized property for Java applications in WebSphere Application Server

 

 

Generally customer runs JDBC application using Db2Connect “IBM Data Server Driver for JDBC and SQLJ” properties in global file DB2JccConfiguration.properties or  at data source/connection URL.

Sometimes customer needs to configure the global property in Application server layer such as WebSphere Application Server or Liberty etc

 

In this article we will show how to configure Db2Connect global property in WebSphere Application Server.

The global property can have any name like “DB2JccConfiguration.properties” and the properties in it would start with db2.jcc , Example

db2.jcc.maxTransportObjects=5

db2.jcc.maxTransportObjectWaitTime=500

db2.jcc.override.traceFile=Trace.txt

 

The global property file name “DB2JccConfiguration.properties” can be configured or added in WebSphere Application server Version 6 or later admin console using IBM Data Server Driver for JDBC and SQLJ data sources to connect to DB2 standalone database or pureScale cluster or Sysplex etc

The following steps and figures illustrate how to configure global properties. we can add custom properties using IBM Data Server Driver for JDBC and SQLJ data source /JNDI properties which are not present in admin console by default , customer can use any new property or configure any new property eg  queryTimeoutInterruptProcessingMode, clientAccountingInformation etc

 

  1. Open the WAS Admin console
  2. On left side under Resource, click on JDBC , click on Data sources, select JNDI resource / data source to which the web application wants to connect and executes as in Figure 1.

 

        Figure 1  Select the DB2 connect database      image

 

3.Click on the selected JNDI/data source, On right hand side under Additional properties   and click on custom properties (figure 2)

 

Figure 2 Click on custom properties for chosen database

image

 

4. Add a new property by clicking on new tab and Provide the name value inputs  for the new property and save(figure 3)

    Example
    Provide the name of global file “DB2JccConfiguration.proprties” and the
    absolute or relative path. The file contents could be the properties which application   
    would like to use.

    db2.jcc.maxTransportObjects=5
    db2.jcc.maxTransportObjectWaitTime=500
    db2.jcc.override. traceFile=Trace.txt

 

Figure 3: Provide the name value inputs for new property

image

 

5. Restart the WebSphere Application Server.

 

Authors:
Sujan S Ghosh (sghosh@rocketsoftware.com)
Advisory software engineer, Db2Connect

Kollol K Misra (kmisra@rocketsoftware.com)

Architect, Db2Connect
 

[{"Business Unit":{"code":"BU053","label":"Cloud & Data Platform"},"Product":{"code":"SSEPDU","label":"Db2 Connect"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm11141996