繁体   English   中英

spring-boot中tomcat的默认连接池?

[英]Default connection pool for tomcat in spring-boot?

使用spring-boot进行tomcat连接池的postgres数据库上最大连接的默认值是多少?

有一个属性spring.datasource.maxActive ,但是当我尝试sysout它时,我得到一个异常:

@Value("${spring.datasource.maxActive}")
private String act;

java.lang.IllegalArgumentException: Could not resolve placeholder 'spring.datasource.maxActive' in string value "${spring.datasource.maxActive}

根据org.apache.tomcat.jdbc.pool.PoolProperties ,默认值为100

您需要在application.properties或application.yaml中设置spring.datasource.max-active以获取bean类中的值

有关常见的application.properties,请参阅https://docs.spring.io/spring-boot/docs/current/reference/html/common-application-properties.html

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM