JDBC Thin连接ORACLE,错误类型ORA-12505

xiaoxiao2021-02-28  114

JDBC thin连接oracle的一种方法:

String dbUrl = "jdbc:oracle:thin:@"+dbIP+":"+1521+":"+SID; 这里的SID并不是在tnsnames.ora中的SERVICE_NAME,而是数据库的SID,查询SID的语句如下:

select instance_name from v$instance;

输入错误的SID会报错:

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

转载请注明原文地址: https://www.6miu.com/read-75737.html

最新回复(0)