A股上市公司传智教育(股票代码 003032)旗下技术交流社区北京昌平校区

 找回密码
 加入黑马

QQ登录

只需一步,快速开始

© 伍仪华 黑马帝   /  2011-7-21 17:42  /  1364 人查看  /  1 人回复  /   0 人收藏 转载请遵从CC协议 禁止商业使用本文

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:
127.0.0.1:1521:ora10g
有什么办法啊?

1 个回复

倒序浏览
黑马网友  发表于 2011-7-21 21:10:19
沙发
sid写错了。
解决办法是要知道数据库的sid,

查看这一段代码:
Connection conn = null;
        try {
            Class.forName("oracle.jdbc.driver.OracleDriver");
            conn = DriverManager.getConnection("jdbc:oracle:thin:@127.0.0.1:1521:compiere", "com", "ldd");
        } catch (ClassNotFoundException e) {
            e.printStackTrace();
        } catch (SQLException e) {
            e.printStackTrace();
        }
回复 使用道具 举报
您需要登录后才可以回帖 登录 | 加入黑马