JAVA连接到oracle 总出现问题 驱动我已经连接好了 求讲解
java.sql.SQLException:Listenerrefusedtheconnectionwiththefollowingerror:ORA-12505,TNS...
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:
localhost:1521:orcl
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:260)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at gogo.gogogo.template(gogogo.java:29)
at gogo.gogogo.main(gogogo.java:13)
这是报错 请问这是为什么啊 展开
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
localhost:1521:orcl
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:111)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:260)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:386)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:413)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:164)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:34)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:752)
at java.sql.DriverManager.getConnection(DriverManager.java:579)
at java.sql.DriverManager.getConnection(DriverManager.java:221)
at gogo.gogogo.template(gogogo.java:29)
at gogo.gogogo.main(gogogo.java:13)
这是报错 请问这是为什么啊 展开
展开全部
应该是sid不正确,给你个链接看看,希望对你有帮助:http://qingfengjushi1.iteye.com/blog/698519。
追问
请问我改了之后无法保存怎么办啊
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
确定启动oracle服务了,以及项目有jdbc的jar包
追问
恩 jar包也加了 SID也改了 还是不可以 。。。。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询