Configuration of sysplex workload balancing and automatic client reroute for Java clients

To configure a IBM® Data Server Driver for JDBC and SQLJ client application that connects directly to Db2 for z/OS® to use sysplex workload balancing and automatic client reroute, you need to use IBM Data Server Driver for JDBC and SQLJ type 4 connectivity. You also need to connect to an address that represents the data sharing group (for group access) or a subset of the data sharing group (for group subset access), and set the properties that enable workload balancing and the maximum number of connections.

You should always configure sysplex workload balancing and automatic client reroute together. When you configure a client to use sysplex workload balancing, automatic client reroute is also enabled. Therefore, you need to change property settings that are related to automatic client reroute only to fine tune automatic client reroute operation.

The following table describes the basic property settings for Java applications.

Table 1. Basic settings to enable sysplex high availability support in Java applications
Data sharing access method IBM Data Server Driver for JDBC and SQLJ setting Value
Group access enableSysplexWLB property true
Group access Connection address:  
Group access server The group IP address or domain name of the data sharing group
Group access port The SQL port number for the Db2 location
Group access database The Db2 location name that is defined during installation
Group subset access enableSysplexWLB property true
Group subset access Connection address:  
Group subset access server The group IP address or domain name of the data sharing group
Group subset access port The port number for the Db2 location alias
Group subset access database The name of the Db2 location alias that represents a subset of the members of the data sharing group
Group access or group subset access commandTimeout Specifies the maximum time in seconds that an application that runs under the IBM Data Server Driver for JDBC and SQLJ waits for any kind of request to the data server to complete before the driver throws an SQLException. The wait time includes time to obtain a transport, perform failover if needed, send the request, and wait for a response. The default is 0.
Group access or group subset access connectionTimeout Specifies the maximum time in seconds that the IBM Data Server Driver for JDBC and SQLJ waits for a reply from a data sharing group when the driver attempts to establish a connection. If the driver does not receive a reply after the amount of time that is specified by connectionTimeout, it throws an SQLException with SQL error code -4499. The default is 0. If connectionTimeout is set to a positive value, that value overrides any other timeout values that are set on a connection, such as loginTimeout.
Group access or group subset access maxTransportObjects Specifies the maximum number of connections that the requester can make to the data sharing group. The default is 1000. To determine the maxTransportObjects value, multiply the expected number of concurrent active connections to the Db2 for z/OS data sharing group by the number of members in the data sharing group.

Additional properties are available for fine tuning sysplex workload balancing and automatic client reroute. You should initially set up sysplex workload balancing using only the basic properties. In most cases, you should not need to set any of the additional properties.

The following IBM Data Server Driver for JDBC and SQLJ Connection or DataSource properties can be used to fine-tune sysplex workload balancing and automatic client reroute:

  • blockingReadConnectionTimeout
  • enableSeamlessFailover
  • loginTimeout

The following IBM Data Server Driver for JDBC and SQLJ configuration properties can be used to fine-tune sysplex workload balancing and automatic client reroute:

  • db2.jcc.maxRefreshInterval
  • db2.jcc.maxTransportObjectIdleTime
  • db2.jcc.maxTransportObjectWaitTime
  • db2.jcc.minTransportObjects