我用JDBC连接oracle的时候报错:
java.sql.SQLException: Listener refused the connection with the following error:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:片断代码如下:private String dbAddress = "jdbc:oracle:thin:@192.168.0.1:1521:db";
private String user = "root";
private String password = "root"; public String getZJDataFromOldFmis(String dwdh, String isPayout, String startDate, String endDate) {
Connection conn = null;
PreparedStatement pstmt = null;
ResultSet rs = null;
StringBuffer sb = new StringBuffer();
try {
Class.forName("oracle.jdbc.driver.OracleDriver");
conn = DriverManager.getConnection(dbAddress, user, password);首先说下配置(如IP,用户名密码,SID等)都是没有问题的。
我用PLSQL都能正常连接上。
用程序就连接不上了。问下这个还有可能是什么原因引起的啊。