日期:2014-05-16  浏览次数:20465 次

Java连接oracle数据--数据库在改为集群之后URL的相应调整

Java连接URL变更方式如下:

原方式:

jdbc.url=jdbc:oracle:thin:@111.117.12.1:1521:test
?

改为集群后的方式:

?

jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST =111.117.12.1)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST =111.117.12.2)(PORT = 1521))(ADDRESS = (PROTOCOL = TCP)(HOST =111.117.12.3)(PORT = 1521))(LOAD_BALANCE=yes)(CONNECT_DATA =(SERVER = DEDICATED)(SERVICE_NAME = test)))
?