Open Source RDBMS - Seamless, Scalable, Stable and Free

한국어 | Login |Register

Versions available for this page: CUBRID 8.2.1 |  CUBRID 8.3.0 |  CUBRID 8.3.1 | 

HA-Related JDBC Configuration

System Requirements
  • JDK 1.5 or higher
  • CUBRID 2008 R2.0 or higher
  • CUBRID JDBC Driver 2008 R2.0 or higher
Connection
Syntax

<url> := jdbc:CUBRID:<host>:<dbname>:<username>:<password> [?<properties>]

<properties> := <property> [&<property>]

<property> := ... | althosts=<alternative_hosts> | rctime=<time>

<alternative_hosts> := <host>:<port> [,<host>:<port>]

<host> := HOSTNAME | IP_ADDR

<time> := SECOND

Description

To use the HA feature in JDBC, add the following keywords to the existing JDBC connection method.

  • althosts : Specifies the information of a broker to connect subsequently (failover) if the connection to the default broker fails. Multiple brokers to failover can be specified, and a connection is attempted according to the order listed by alhosts.
  • rctime : The interval for attempting failback to the broker where a failure occurs. This value is used when a failover is performed to the standby broker due to the failure in the active broker. After a failure occurs, the system connects to the broker specified by althosts (failover), end the transaction and then attempts to connect to the existing active broker at every rctime (failback). If rctime is not specified, it is configured to 600 seconds.
Example

In the following example, if a failure occurs in Broker_b1 (default broker), the system attempts to make a connection to Broker_b2 and then to Broker_b3. If the failover is performed to the broker, the system attempts failback at every 600 seconds.

URL=jdbc:CUBRID:Broker_b1:31000:nbd:nbd:nbd:?althosts=Broker_b2:31000,Broker_b3:31000&rctime=600