参考资源
Druid源码
添加依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.1.0</version>
</dependency>
在BootStrap.yml文件添加配置
datasource:
druid:
url: jdbc:mysql://xxxxxxxxx:xxxx/xxxx?useUnicode=true&characterEncoding=utf-8
username: xxxx
password: xxxx
initial-size: 5
max-active: 50
min-idle: 5
max-wait: 60000
validationQuery: select 1
testWhileIdle: true
filters: stat,wall,log4j
statViewServlet:
loginUsername: xxxxx
loginPassword: xxxxx
访问Durid监控
http://localhost:8080/druid