与oracle数据库连接时出现Spring错误ORA-12505,TNS:listener当前不知道连接描述符中给出的SID

问题描述

我正在通过连接到vm服务器上的oracle数据库在本地运行spring boot应用程序。尽管在oracle sql Developer上测试连接成功,但是在同一端口和凭据上运行应用程序时,它给出的是 ORA-12505,TNS:listener当前不知道连接描述符中给出的SID

错误:-

enter image description here

设置:-

enter image description here

数据库连接:-

enter image description here

解决方法

您的连接字符串格式错误,这就是为什么它无法识别数据库的原因,您必须使用:

datasource:
  url: jdbc:oracle:thin:@//localhost:1521/orclcdb