Dror
Dror

Reputation: 5505

unknown datasource properties for springboot

I'm following a tutorial about springboot that tells to add the following rows to my application.properties file

spring.datasource.max-active=10
spring.datasource.max-idle=8
spring.datasource.max-wait=10000
spring.datasource.min-evictable-idle-time-millis=1000
spring.datasource.min-idle=8
spring.datasource.time-between-eviction-runs-millis=1

however spring sts marks the rows as "unknown property"

i saw that the "intellisense" feature offers the following (properties with .tomcat):

spring.datasource.tomcat.max-active=10
spring.datasource.tomcat.max-idle=8
spring.datasource.tomcat.max-wait=10000
spring.datasource.tomcat.min-evictable-idle-time-millis=1000
spring.datasource.tomcat.min-idle=8
spring.datasource.tomcat.time-between-eviction-runs-millis=1

so i'm wondering if the first set of properties is obsolete, and replaced by the second set

Thanks

Upvotes: 1

Views: 3818

Answers (1)

sagarr
sagarr

Reputation: 1212

The formar one is more standard props from boot and later one is implementation specific, e.g if you are using tomcat-jdbc then .tomcat. props are correct, see for more details:

http://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-sql.html#boot-features-connect-to-production-database

https://github.com/spring-projects/spring-boot/blob/master/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/jdbc/DataSourceProperties.java

Upvotes: 0

Related Questions