using '(the DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(TCP) PROTOCOL=(HOST=11.39.22.66) (9900) PORT=)) (CONNECT_DATA=(SERVICE_NAME=former) https://bbs.csdn.net/topics/)'
Using the connection string, is a direct copy tnsnames. Ora, PLSQL can access to, but dblink show "TNS connection timeout"
CodePudding user response:
Dblink depends on the server, not the machineCodePudding user response:
Using the back can also use the service nameCodePudding user response:
Using the direct write '11.39.22.66 @ wouldn' tryCodePudding user response:
Use DB_LINK first ping again Telnet server if no problem, then look at servername, it is single or cluster,CodePudding user response:
1, conn user/[email protected]:9900/former look to whether can connect2, make sure there is no firewall between two servers on the network, such as limit
CodePudding user response:
Private static final String DRIVER="... The oracle JDBC DRIVER OracleDriver ";Private static final String URL="JDBC: oracle: thin: @ localhost: 1521: xe";
Private static final String USERNAME="system";
Private static final String PASSWORD="sun";
Public static Connection getConnection () {
The Connection conn=null;
Try {
Class.forname (DRIVER);
Conn=DriverManager. GetConnection (URL, USERNAME, PASSWORD);
} the catch (a ClassNotFoundException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
} the catch (SQLException e) {
//TODO Auto - generated the catch block,
e.printStackTrace();
}
Return the conn.
}