IBM DB2 Manual page 104

Table of Contents

Advertisement

|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| | |
| |
| |
|
88
Application Programming Guide and Reference for Java
v If your installation is using more than one Connection manager for client
reroute, and your application is using the DataSource interface for
connections, use one of the following techniques:
– Set the server names and port numbers in DataSource properties:
a. Set the serverName and portNumber properties to the server name
and port number of the main Connection Manager that you want to
use.
b. Set the clientRerouteAlternateServerName and
clientRerouteAlternatePortNumber properties to the server names and
port numbers of the alternative Connection Managers that you want to
use.
– Configure JNDI for client reroute by using a DB2ClientRerouteServerList
instance to identify the main Connection Manager and alternative
Connection Managers.
a. Create an instance of DB2ClientRerouteServerList.
b. Set the
com.ibm.db2.jcc.DB2ClientRerouteServerList.primaryServerName and
com.ibm.db2.jcc.DB2ClientRerouteServerList.primaryPortNumber
properties to the server name and port number of the main Connection
Manager that you want to use.
c. Set the
com.ibm.db2.jcc.DB2ClientRerouteServerList.alternateServerName
and
com.ibm.db2.jcc.DB2ClientRerouteServerList.alternatePortNumber
properties to the server names and port numbers of the alternative
Connection Managers that you want to use.
d. To make the DB2ClientRerouteServerList persistent:
1) Bind the DB2ClientRerouteServerList instance to the JNDI registry.
2) Assign the JNDI name of the DB2ClientRerouteServerList object to
the IBM Data Server Driver for JDBC and SQLJ
clientRerouteServerListJNDIName property.
2. Connect to the data source that represents the main Connection Manager.
The alternative Connection Managers are used for the initial connection only,
unless seamless failover is enabled. For the initial connection, if the main
Connection Manager is down, the IBM Data Server Driver for JDBC and SQLJ
attempts to make a connection to the Connection Manager that is specified by the
first set of values in clientRerouteAlternateServerName and
clientRerouteAlternatePortNumber or
com.ibm.db2.jcc.DB2ClientRerouteServerList.alternateServerName and
com.ibm.db2.jcc.DB2ClientRerouteServerList.alternatePortNumber.
Examples
Suppose that your installation has two Connection Managers with the following
server names and port numbers:
Server name
cm1.sf.ibm.com
cm2.sf.ibm.com
Port number
50000
50002

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents