在使用idea连接oracle数据库时,提示ORA-12505报错
[66000][12505] Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor oracle.net.ns.NetException: Listener refused the connection with the following error: ORA-12505, TNS:listener does not currently know of SID given in connect descriptor.
但是在使用sqlplus和plsql连接的时候均没有问题,这里使用的oracle的可插拔数据库,实例是orclpdb,跟普通的数据库有些区别,不需要修改其他的东西,只要将URL中端口号后面的冒号,改成斜杠即可,即:
从jdbc:oracle:thin:@192.168.3.31:1521:orclpdb
改为jdbc:oracle:thin:@192.168.3.31:1521/orclpdb,虽然idea会在斜杠下标红,但是并不影响。