https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter
1.maven依賴
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.10</version>
</dependency>
2.application.yml配置
spring:
application:
name: mybatis-server
datasource:
driverClassName: com.mysql.jdbc.Driver
url: jdbc:mysql://localhost:3306/flowable_demo?useUnicode=true&characterEncoding=utf-8
username: root
password: admin123456
#druid配置
druid:
initial-size: 5
min-idle: 10
max-active: 20
max-wait: 60000
timeBetweenEvictionRunsMillis: 600000
minEvictableIdleTimeMillis: 300000
validationQuery: select 1
testWhileIdle: true
testOnBorrow: false
testOnReturn: false
poolPreparedStatements: true
maxOpenPreparedStatements: 20
async-init: false
web-stat-filter:
enabled: true
stat-view-servlet:
enabled: true
server:
port: 8081