Java连接oracle数据--数据库在改为集群之后URL的相应调整 博客分类: oracle OracleJavaJDBC
程序员文章站
2024-03-07 10:20:56
...
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)))