本文主要是介绍Spring Boot 整合 Mybatis (三) druid-spring-boot-starter Druid数据源,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!
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-serverdatasource:driverClassName: com.mysql.jdbc.Driverurl: jdbc:mysql://localhost:3306/flowable_demo?useUnicode=true&characterEncoding=utf-8username: rootpassword: admin123456#druid配置druid:initial-size: 5min-idle: 10max-active: 20max-wait: 60000timeBetweenEvictionRunsMillis: 600000minEvictableIdleTimeMillis: 300000validationQuery: select 1testWhileIdle: truetestOnBorrow: falsetestOnReturn: falsepoolPreparedStatements: truemaxOpenPreparedStatements: 20async-init: falseweb-stat-filter:enabled: truestat-view-servlet:enabled: true
server:port: 8081
3.启动http://127.0.0.1:8081/druid/index.html
这篇关于Spring Boot 整合 Mybatis (三) druid-spring-boot-starter Druid数据源的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!