当前位置:编程学习 > JAVA >>

本人初学java中的使用JDBC, 可是连接出错:Listener refused the connection with the following error:

本人初学java中的使用JDBC, 可是连接出错: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: localhost:1521:news at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112) at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:261) at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:387) at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:414) at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:165) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:35) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:801) at java.sql.DriverManager.getConnection(Unknown Source) at java.sql.DriverManager.getConnection(Unknown Source) at com.pb.news.dao.NewsDao.getNewsList(NewsDao.java:22) at com.pb.news.dao.NewsDao.main(NewsDao.java:59) Exception in thread "main" java.lang.NullPointerException at com.pb.news.dao.NewsDao.getNewsList(NewsDao.java:48) at com.pb.news.dao.NewsDao.main(NewsDao.java:59) 我不知道我哪里设置没弄好, 我电脑系统是windows XP ,Oracle是10.2.0版本. 求助大家帮帮看如何解决
CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,