gpt4 book ai didi

java - ORA-12505,TNS :listener does not currently know of SID given in connect descriptor

转载 作者:行者123 更新时间:2023-12-01 09:05:19 26 4
gpt4 key购买 nike

连接代码:

Connection connection = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:orcl", "USER_NAME", "PASSWORD";

异常(exception):

Exception in thread "main" 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

at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:419) at oracle.jdbc.driver.PhysicalConnection.(PhysicalConnection.java:536) at oracle.jdbc.driver.T4CConnection.(T4CConnection.java:228) at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:32) at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:521) at java.sql.DriverManager.getConnection(DriverManager.java:571)

最佳答案

已解决:

将连接字符串中的“orcl”更改为“XE”。

关于java - ORA-12505,TNS :listener does not currently know of SID given in connect descriptor,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41327701/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com