Purpose

Defines a list of alternate database servers that is used to failover new or lost connections, depending on the failover method selected.

Valid Values


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

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 the port number of the primary server is unspecified, the default port number of 5432 is used.

DatabaseName is an optional connection property.

Data Source Methods

public String getAlternateServers()

public void setAlternateServers(String)

Default

No default value

Data Type

String

Example

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


jdbc:datadirect:postgresql://server1:5432;DatabaseName=TEST;User=test;
Password=secret;AlternateServers=(server2:5432;DatabaseName=TEST2,
server3:5432;DatabaseName=TEST3)
Note: The User and Password properties are not required to be stored in the connection string. They can also be passed separately by the application.

See also

Configuring failover