JDBC에서 HA 기능을 사용하려면, 브로커 장애 시 연결할 브로커 연결 정보를 URL string에 추가로 지정하여야 한다. HA를 위해 지정되는 속성은 장애 시 연결(failover)할 하나 이상의 standby 브로커의 호스트 정보(althosts), 또는 active 서버의 장애 복구 시 active 브로커로 연결(failback)을 시도하는 주기(rctime)이다. JDBC에서 연결 설정을 위한 상세한 설명은 연결 설정을 참고한다.
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