Using the AlternateServers Property
- Last Updated: May 15, 2020
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Db2 5.1
- MySQL 5.1
- Progress OpenEdge 5.1
- SAP Sybase 5.1
- Documentation
Connection information for alternate servers is specified using the AlternateServers property with either a connection URL through the JDBC Driver Manager or a JDBC data source. The value of the AlternateServers property is a string that has the format:
(servername1[:port1][;property=value][,servername2[:port2]
[;property=value]]...)
where:
servername1 is the IP address or server name of the
first alternate database server, servername2 is the IP address or server
name of the second alternate database server, and so on. The IP address or server name is
required for each alternate server entry.
port1 is the port number on which the first alternate database server is listening, port2 is the port number on which the second alternate database server is listening, and so on. The port number is optional for each alternate server entry. If unspecified, the port number specified for the primary server is used.
property
=
value is the DatabaseName connection property. This property is optional
for each alternate server entry. For example:
jdbc:datadirect:openedge://server1:2003;DatabaseName=TestServer;
User=test;Password=secret;
AlternateServers=(server2:2003;
DatabaseName=TestServer,server3:2003)
If you do not specify the DatabaseName connection property in an alternate server entry,
the connection to that alternate server uses the property specified in the URL for the
primary server. For example, if you specify DatabaseName=TestServer for the
primary server, but do not specify the DatabaseName property in the alternate server entry
as shown in the following URL, the driver tries to connect to the TestServer database on
server1:
jdbc:datadirect:openedge://server1:2003;DatabaseName=TestServer;
AlternateServers=(server2:2003,server3:2003)