Versions available for this page: CUBRID 8.2.1 | CUBRID 8.3.0 | CUBRID 8.3.1 |
To use the HA feature in JDBC, you must additionally specify the connection information of the broker, on which failover will be performed when a broker failure occurs, to the URL string. Attributes that are specified for HA are the host information (althosts) of one or more standby brokers that will be connected when there is a failure or the interval (rctime) at which the connection (failback) to the active broker will be attempted when recovering from the failure of the active server. For details about connection configuration in JDBC, see Connection Configuration.
jdbc:cubrid:<host>:<port>:<db-name>:[user-id]:[password]:?[<property> [& <property>]]
host :
hostname | ip_address
property :
althosts= <alternative_hosts> | rctime= <second> | charset= <character_set>
alternative_hosts :
<standby_broker1_host>:<port> [,<standby_broker2_host>:<port>]
--connection URL string when user name and password omitted
URL=jdbc:CUBRID:127.0.0.1:31000:db1:::
--connection URL string when charset property specified
URL=jdbc:CUBRID:127.0.0.1:31000:db1:::?charset=utf-8
--connection URL string when a property(althosts) specified for HA
URL=jdbc:CUBRID:127.0.0.1:31000:db1:::?althosts=127.0.0.2:31000,127.0.0.3:31000
--connection URL string when properties(althosts,rctime) specified for HA
URL=jdbc:CUBRID:127.0.0.1:31000:db1:::?althosts=127.0.0.2:31000,127.0.0.3:31000&rctime=600
--connection URL string when properties(althosts,rctime, charset) specified for HA
URL=jdbc:CUBRID:127.0.0.1:31000:db1:::?althosts=127.0.0.2:31000,127.0.0.3:31000&rctime=600&charset=utf-8