DB2 Version 10.1 for Linux, UNIX, and Windows

Configuration of client affinities for Java clients for DB2® for Linux, UNIX, and Windows connections

To enable support for client affinities in Java™ applications, you set properties to indicate that you want to use client affinities, and to specify the primary and alternate servers.

The following table describes the property settings for enabling client affinities for Java applications.

Table 1. Property settings to enable client affinities for Java applications
IBM® Data Server Driver for JDBC and SQLJ setting Value
enableClientAffinitiesList DB2BaseDataSource.YES (1)
clientRerouteAlternateServerName A comma-separated list of the primary server and alternate servers
clientRerouteAlternatePortNumber A comma-separated list of the port numbers for the primary server and alternate servers
enableSeamlessFailover DB2BaseDataSource.YES (1) for seamless failover; DB2BaseDataSource.NO (2) or enableSeamlessFailover not specified for no seamless failover
maxRetriesForClientReroute The number of times to retry the connection to each server, including the primary server, after a connection to the primary server fails. The default is 3.
retryIntervalForClientReroute The number of seconds to wait between retries. The default is no wait.
affinityFailbackInterval The number of seconds to wait after the first transaction boundary to fail back to the primary server. Set this value if you want to fail back to the primary server.