遇到问题:
ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
解决方案:(参考)
jdbc连接数据库的时候,需要使用数据库的sid_name,而不是数据库的services_name.而使用plsql连接数据库的时候,只需要数据库的services_name即可,所以修改连接字符串中的services_name 为sid_name.
查询sid_name的方法
select INSTANCE_NAME from v$instance;
查出PL/SQL工具中的数据库【127.0.0.1/ORCL】sid_name错了,应该为
ORCLF。