带有 tomcat 连接池和 oracle 数据源配置的 Spring Boot 2?



我需要有关Tomcat连接池的数据源配置的帮助。最好是,它应该/将只是application.property/yml配置。我说的对吗??

我在 yml 中有以下数据源配置,它在 Spring 1.5.8 中工作。我只是尝试迁移到 2.O,它抛出错误,因为 Hikari CP 是新的默认连接池。来自Pivotal和其他问题的迁移指南很棘手。提前感谢! 下面的配置在 Spring Boot 1.5.8 中对我来说工作正常

datasource:
url: jdbc:oracle:thin:@domain:port:sid
username: username
password: password
driver-class-name: oracle.jdbc.driver.OracleDriver
tomcat:
min-idle: 10
max-wait: 10000
max-idle: 20
max-active: 50
test-on-borrow: true

您可能希望将单词"url"编辑为"jdbc-url",以便第二行变为jdbc-url: jdbc:oracle:thin:@domain:port:sid

这是因为在 Spring Boot 2 中,HikariCP 是默认连接池,并且与将用于配置数据源的属性键中的新更改相关联。由于HikariCP,它们中很少有必须以不同的方式定义。

最新更新