Purpose

A list of alternate database servers that is used to failover new or lost connections, depending on the failover method selected. See FailoverMode for information about choosing a failover method.

Valid values

(servername1[:port1][;property=value[;...]][,servername2[:port2]
[;property=value[;...]]]...)

Behavior

The server name (servername1, servername2, and so on) is required for each alternate server entry. Port number (port1, port2, and so on) and connection properties (property=value) are optional for each alternate server entry. If the port is unspecified, the port number of the primary server is used. If a port number for the primary server is unspecified, a default port number of 1433 is used.

The driver allows only one optional connection property, DatabaseName.

Notes

If using failover with Microsoft Cluster Server (MSCS), which determines the alternate server for failover instead of the driver, any alternate server specified must be the same as the primary server. For example:

jdbc:datadirect:sqlserver://server1:1433;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server1:1433;DatabaseName=TEST)

Example

The following URL contains alternate server entries for server2 and server3. The alternate server entries contain the optional DatabaseName property.

jdbc:datadirect:sqlserver://server1:1433;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server2:1433;DatabaseName=TEST2,
server2:1433;DatabaseName=TEST3)

Data source method

public String getAlternateServers()

public void setAlternateServers(String)

Default

None

Data type

String

See also

  • FailoverMode
  • Note: For more information on connection failover and different levels of failover protection provided by the driver, refer to Failover in the Progress DataDirect for JDBC Drivers Reference.