简体   繁体   English

如何在Spring Boot application.properties中配置Oracle RAC

[英]How to config Oracle RAC in spring boot application.properties

I am using spring boot 1.5.0.release and I want to connect my application to oracle database using oracle RAC (Fast Connection Failover) and the jdbc string like this : 我正在使用Spring Boot 1.5.0.release,我想使用oracle RAC(快速连接故障转移)和jdbc字符串将应用程序连接到oracle数据库:

spring.datasource.url:jdbc:oracle:thin:jdbc:oracle:thin:@(DESCRIPTION=(ENABLE=BROKEN)(LOAD_BALANCE=ON)(FAILOVER=ON)(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=rac1-vip-ent.mncplaymedia.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac2-vip-ent.mncplaymedia.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac3-vip-ent.mncplaymedia.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac4-vip-ent.mncplaymedia.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=rac5-vip-ent.mncplaymedia.com)(PORT=1521)))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=ent)(FAILOVER_MODE=(TYPE=SELECT)(METHOD=BASIC)(RETRIES = 180)(DELAY = 5))))

spring.datasource.username:xxxx
spring.datasource.password:xxx
spring.datasource.driver-class-name:oracle.jdbc.driver.OracleDriver

and I got error Datasource return null like this : 而且我得到错误数据源返回null像这样:

Caused by: java.sql.SQLTransientConnectionException: DataSource returned null unexpectedly
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:343) ~[HikariCP-2.5.1.jar:na]
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:506) ~[HikariCP-2.5.1.jar:na]
... 71 common frames omitted

any one get this problem before, please help me to resolve this. 任何人之前都会遇到此问题,请帮助我解决此问题。 sorry for my bad english. 对不起,我的英语不好。

您可以通过Spring博客查看UCP吗?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何阅读Spring Boot application.properties? - How to read Spring Boot application.properties? 使用 Spring Boot Cloud Config 更改类路径中的 application.properties - Use Spring Boot Cloud Config to change application.properties in classpath 如何将 heroku config var 传递给 spring boot 的 application.properties? - How to pass heroku config var to spring boot's application.properties? 如何从 spring-boot 中的 application.properties 进行配置 class? - How to make config class from application.properties in spring-boot? 如何在Spring Boot中的application.properties中指定外部属性文件? - How to specify external properties files in application.properties in Spring Boot? 如何从Spring Boot Config Server服务的其他属性文件中的application.properties获取密钥? - How can I get the keys from application.properties within other properties files served by Spring Boot Config Server? 如何在 Spring-Boot 的生产过程中覆盖 application.properties? - How to override application.properties during production in Spring-Boot? 如何在 spring 引导中读取构造函数内的 application.properties 值? - How to read application.properties value inside the constructor in spring boot? 如何在 spring 引导中创建每个模块 application.properties? - How to create per module application.properties in spring boot? spring-boot如何添加多个application.properties文件? - How to add multiple application.properties files in spring-boot?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM