java.sql.SQLException:Listener refused the connection with the following error:ORA-12505
错误日志
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
详细信息:
数据库连接(由于是生产环境,ip,端口调整为假值)
问题分析
通过日志可以看出,错误是连接数据库的时候连接报错了,然后校验数据库信息,连接配置,
均没有发现有什么异常,核对测试环境配置,发现测试环境配置和生产格式一致。
仔细一看日志:listener does not currently know of SID given in connect descriptor
SID引起了我的注意,然后百度了一下,JDBC连接配置的格式:
jdbc:oracle:thin