簡體   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