当前位置: 移动技术网 > IT编程>数据库>Oracle > JDBC连接集群数据库的方法

JDBC连接集群数据库的方法

2017年12月12日  | 移动技术网IT编程  | 我要评论

在连接数据库的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

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网