Note: To turn off failover, do not specify a value for the AlternateServers property.
Note: If using failover with DB2 High Availability Disaster Recovery (HADR), the primary server must be the primary server configured in your HADR system and any alternate server must be a standby server configured in your HADR system.
2. Choose a failover method by setting the FailoverMode connection property. The default method is connection failover (FailoverMode=connect). See Using Failover for an overview of each failover method.
3. If FailoverMode=extended or FailoverMode=select, set the FailoverGranularity property to specify how you want the driver to behave if exceptions occur while trying to reestablish a lost connection. The default behavior of the driver is to continue with the failover process and post any exceptions on the statement on which they occur (FailoverGranularity=nonAtomic).
5. Optionally, set the FailoverPreconnect property if you want the driver to establish a connection with the primary and an alternate server at the same time. The default behavior is to connect to an alternate server only when failover is caused by an unsuccessful connection attempt or a lost connection (FailoverPreconnect=false).