Failover
- Last Updated: March 1, 2022
- 1 minute read
- DataDirect Connectors
- JDBC
- IBM Informix 6.0
- Documentation
This string configures the driver to use connection failover in conjunction with connection retry.
jdbc:datadirect:informix://servername:port;InformixServer=informixserver;
DatabaseName=databasename;User=userID;Password=password;
AlternateServers=(alternateserver);
ConnectionRetryCount=connectionretrycount;ConnectionRetryDelay=connectionretrydelay;
[property=value[;...]];
where:
- servername
-
is the IP address or name of the primary server.
- port
-
is the number of the TCP/IP port of the primary server.
- informixserver
-
is the name of the Informix database server to which you want to connect.
- databasename
-
is the name of the database in the primary server to which you want to connect.
- userID
-
specifies the user ID that is used to connect to the Informix database.
- password
- specifies a password that is used to connect to your Informix database.
- alternateserver
-
specifies a list of alternate database servers that is used to failover new or lost connections, depending on the failover method selected. This example uses the default failover method, connection failover.
- connectionretrycount
- specifies the number of times the driver retries connection attempts to the primary database server, and if specified, alternate servers until a successful connection is established.
- connectionretrydelay
-
specifies the number of seconds the driver waits between connection retry attempts when ConnectionRetryCount is set to a positive integer.
- property=value
- specifies connection property settings. Multiple properties are separated by a semi-colon.
The following example configures the driver to use connection failover in conjunction with connection retry.
Connection conn = DriverManager.getConnection
("jdbc:datadirect:informix://myserver1:2003;InformixServer=myinformixserver1;
DatabaseName=payroll;User=jsmith;Password=secret;
AlternateServers=(myserver2:2003;InformixServer=myinformixserver2,myserver3:2003);
ConnectionRetryCount=2;ConnectionRetryDelay=5;");