java连接oracle双机服务器

连接字符串:

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=xmjj03)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=xmjj04)(PORT=1521))(LOAD_BALANCE=yes))(CONNECT_DATA=(SERVICE_NAME=waynet)))

或者:

jdbc:oracle:thin:@(description=(address_list= 
(address=(host=192.168.0.201) (protocol=tcp)(port=1521)) 
(address=(host=192.168.0.202)(protocol=tcp) (port=1521)) 
(address=(host=192.168.0.203) (protocol=tcp)(port=1521)) 
(load_balance=yes)(failover=yes))(connect_data=(service_name= taf)))

jdbc:oracle:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE = yes)
(ADDRESS=(PROTO =TCP)(HOST=node1)(PORT=1521))(ADDRESS=(PROTO=TCP)(HOST=node2)(PORT=1521))

(ADDRESS=(PROTO=TCP)(HOST=node3)(PORT=1521))(ADDRESS=(PROTO =TCP)(HOST=node4)(PORT=1521))

(CONNECT_DATA =(SERVICE_NAME =oracleServerName)(failover_mode = (type = select)

(method =basic)(retries = 20)(delay = 15)))))

你可能感兴趣的:(数据库)