gpt4 book ai didi

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

转载 作者:太空宇宙 更新时间:2023-11-04 10:46:12 24 4
gpt4 key购买 nike

我正在使用 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

我收到错误 Datasource return 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

任何人以前遇到过这个问题,请帮我解决这个问题。抱歉我的英语不好。

最佳答案

你能看看 UCP with Spring博客 ?

关于java - 如何在 Spring Boot application.properties 中配置 Oracle RAC,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48394616/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com