JDBC连接集群数据库的方法
程序员文章站
2023-11-25 16:24:58
在连接数据库的url地址有点不一样复制代码 代码如下:jdbc:oracle:thin:@(description=(load_balance=on)(address_li...
在连接数据库的url地址有点不一样
复制代码 代码如下:
jdbc:oracle:thin:@(description=
(load_balance=on)
(address_list=
(address=(protocol=tcp)(host=ip1)(port=1521))
(address=(protocol=tcp)(host=ip2)(port=1521))
)
(connect_data=(service_name=服务名)))
url=jdbc:oracle:thin:@(description =
(address_list =
(address = (protocol = tcp)(host = 192.168.0.77)(port = 1521))
(address = (protocol = tcp)(host = 192.168.0.91)(port = 1521))
(address = (protocol = tcp)(host = hostip3)(port = 1521))
)
(connect_data =(service_name = appdb)))
username=imei_app
password=imei_app