配置:
- 项目来源:SpringBoot 实战
- InteIIiJ IDEA 2018.2.4
- Windows 10 专业版 64位
- Oracle:win64_11gR2_database
- Hibernate 框架
- oracle.jdbc.OracleDriver 版本 12.1.0.2
异常:
-
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
原因:安装后的默认数据库实例是:ORCL,则在 application.properties 中配置的 url 应该是:
spring.datasource.url=jdbc\:oracle\:thin\:@127.0.0.1\:1521\:ORCL