springboot笔记示例三:集成druid
pom.xml添加依赖
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid-spring-boot-starter</artifactId>
<version>1.2.16</version>
</dependency>
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
yml配置
spring:
datasource:
druid:
web-stat-filter:
exclusions: "*.js,*.gif,*.jpg,*.png,*.css,*.ico,/druid/*"
stat-view-servlet:
enabled: true
login-username: root
login-password: root
dynamic:
primary: ck
strict: false
datasource:
mysql:
driver-class-name: com.mysql.cj.jdbc.Driver
username: root
password: b3tx@4!yJ^fDXaQv
url: jdbc:mysql://10.64.9.9:9558/yding_server?useUnicode=true&characterEncoding=UTF-8&useSSL=false&autoReconnect=true&failOverReadOnly=false&serverTimezone=GMT%2B8
type: com.alibaba.druid.pool.DruidDataSource
druid:
initial-size: 5
min-idle: 10
max-active: 20
filters: stat,log4j
ck:
driver-class-name: ru.yandex.clickhouse.ClickHouseDriver
url: jdbc:clickhouse://10.64.9.9:9556/default
username: default
password: kBQf^5taQ!ZfWbZf
druid:
initial-size: 5
min-idle: 10
max-active: 20
filters: stat,log4j
mybatis-plus:
mapper-locations: classpath:mapper/*.xml
typeAliasesPackage: com.nit.clickhouse.entity
global-config:
db-config:
id-type: assign_uuid
table-underline: true
configuration:
map-underscore-to-camel-case: true
druid使用
http://localhost:8080/druid/
#账号:yml.login-username配置的root