DB2 10.5 for Linux, UNIX, and Windows

Configuration of DB2 for Linux, UNIX, and Windows workload balancing support for Java clients

To configure a IBM® Data Server Driver for JDBC and SQLJ client application that connects to a DB2® for Linux, UNIX, and Windows DB2 pureScale® instance for workload balancing, you need to connect to a member of the DB2 pureScale instance, and set the properties that enable workload balancing and the maximum number of connections.

Java™ client applications support transaction-level workload balancing. They do not support connection-level workload balancing. Workload balancing is supported only for connections to a DB2 pureScale instance.

Workload balancing support for Java client applications that connect to DB2 for Linux, UNIX, and Windows works for connections that are obtained using the javax.sql.DataSource, javax.sql.ConnectionPoolDataSource, javax.sql.XADataSource, or java.sql.DriverManager interface.

Restriction: Workload balancing support for connections that are made with the DriverManager interface has the following restrictions:

The following table describes the basic property settings for enabling DB2 for Linux, UNIX, and Windows workload balancing for Java applications.

Table 1. Basic settings to enable workload support in Java applications
IBM Data Server Driver for JDBC and SQLJ setting Value
enableSysplexWLB property true
maxTransportObjects property The maximum number of connections that the requester can make to the DB2 pureScale instance
Connection address: server The IP address of a member of a DB2 pureScale instance1
Connection address: port The SQL port number for the DB2 pureScale instance1
Connection address: database The database name
Note:
  1. Alternatively, you can use a distributor, such as Websphere Application Server Network Deployment, or multihomed DNS to establish the initial connection to the database.
    • For a distributor, you specify the IP address and port number of the distributor. The distributor analyzes the current workload distribution, and uses that information to forward the connection request to one of the members of the DB2 pureScale instance.
    • For multihomed DNS, you specify an IP address and port number that can resolve to the IP address and port number of any member of the DB2 pureScale instance. Multihomed DNS processing selects a member based on some criterion, such as simple round-robin selection or member workload distribution.

If you want to fine-tune DB2 for Linux, UNIX, and Windows workload balancing support, global configuration properties are available. The properties for the IBM Data Server Driver for JDBC and SQLJ are listed in the following table.

Table 2. Configuration properties for fine-tuning DB2 for Linux, UNIX, and Windows workload balancing support for connections from the IBM Data Server Driver for JDBC and SQLJ
IBM Data Server Driver for JDBC and SQLJ configuration property Description
db2.jcc.maxRefreshInterval Specifies the maximum amount of time in seconds between refreshes of the client copy of the server list that is used for workload balancing. The default is 10. The minimum valid value is 1.
db2.jcc.maxTransportObjectIdleTime Specifies the maximum elapsed time in number of seconds before an idle transport is dropped. The default is 10. The minimum supported value is 0.
db2.jcc.maxTransportObjectWaitTime Specifies the number of seconds that the client will wait for a transport to become available. The default is 1. The minimum supported value is 0.
db2.jcc.minTransportObjects Specifies the lower limit for the number of transport objects in a global transport object pool. The default value is 0. Any value that is less than or equal to 0 means that the global transport object pool can become empty.