JDBC连接集群数据库的方法

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

(0)
上一篇 2022年3月22日
下一篇 2022年3月22日

相关推荐