CONNECTION_FAILOVER connection property

CONNECTION_FAILOVER is a Boolean-valued connection property you can use when jConnect uses JNDI to get connection information.

If CONNECTION_FAILOVER is set to True, jConnect makes multiple attempts to connect to a server. If one attempt to connect to a host and port number associated with a server fails, jConnect uses JNDI to get the next host and port number associated with the server and attempts to connect through them. Connection attempts proceed sequentially through all the hosts and ports associated with a server.

For example, if CONNECTION_FAILOVER is set to True, and a database server is associated with the following hosts and port numbers, as in the earlier LDAP example:

1.3.6.1.4.1.897.4.2.5:TCP#1#giotto 1266
1.3.6.1.4.1.897.4.2.5:TCP#1#giotto 1337
1.3.6.1.4.1.897.4.2.5:TCP#1#standby 4444

To get a connection to the server, jConnect tries to connect to the host “giotto” at port 1266. If this fails, jConnect tries port 1337 on “giotto.” If this fails, jConnect tries to connect to host “standby1” through port 4444.

The default for CONNECTION_FAILOVER is True.

If CONNECTION_FAILOVER is set to False, jConnect attempts to connect to an initial host and port number. If the attempt fails, jConnect throws a SQL exception and does not try again.