黑马程序员技术交流社区

标题: 数据库问题 [打印本页]

作者: 伍仪华    时间: 2011-7-21 17:42
标题: 数据库问题
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
有什么办法啊?
作者: 匿名    时间: 2011-7-21 21:10
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();
        }




欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) 黑马程序员IT技术论坛 X3.2