当前位置: > 数据库 > Oracle >

JAVA 连接 ORACLE RAC 字符串

时间:2015-01-21 23:46来源:linux.it.net.cn 作者:IT

做个笔记

 

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=vip1)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vip2)(PORT=1521))(LOAD_BALANCE=yes)(FAILOVER=on))(CONNECT_DATA=(SERVICE_NAME=gs)))

 

 
String URL=
"jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=" +
        "(ADDRESS=(PROTOCOL=TCP)(HOST=ip1)(PORT=1521))" +
        "(ADDRESS=(PROTOCOL=TCP)(HOST=ip2)(PORT=1521))" +
        "(LOAD_BALANCE=yes)(FAILOVER=on))" +
        "(CONNECT_DATA=(SERVICE_NAME=orcl)))" ;
 
(责任编辑:IT)
------分隔线----------------------------