1、Java JDBC链接Oracle11G R2时遇到了如下错误:

Listener refused the connection with the following error:

ORA-12505, TNS:listener does not currently know of SID given in connect descriptor
The Connection descriptor used by the client was:
192.168.0.11:1521:ORCLDB

2、通过PLSQL Developer 能正常链接

网上查阅相关资料,得知java jdbc链接oracle 不能使用service_name,需要使用INSTANCE_NAME

使用SQL查询 SELECT INSTANCE_NAME FROM v$instance;

将查询结果替换jdbc链接字符串中的ORCLDB即可.

相关文章:

  • 2022-12-23
  • 2021-05-27
  • 2022-12-23
  • 2022-01-07
  • 2021-07-12
  • 2021-10-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-05-19
  • 2021-10-23
  • 2022-12-23
  • 2021-10-25
  • 2021-07-16
相关资源
相似解决方案