jdbc 连接oracle rac 一会连的上一会连不上的问题
连接代码如下:
Class.forName("oracle.jdbc.driver.OracleDriver").newInstance();
String addrRAC = "(ADDRESS=(PROTOCOL=TCP)(HOST =host1)(PORT =1521))(ADDRESS=(PROTOCOL=TCP)(HOST =host2)(PORT =1521))";
String url = "jdbc:oracle:thin:@" + "(DESCRIPTION="
+ "(ADDRESS_LIST=" + addrRAC + ")" + "(CONNECT_DATA="
+ "(SERVER=DEDICATED)" + "(SERVICE_NAME=racdbs)" + ")"
+ ")";
Connection oracn = DriverManager.getConnection(url, "system",
"qz123456");
为什么会出现一会连接的上一会连不上呢?希望高手解决问题。