springboot用yml配置druid

Posted TaylorLambert

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了springboot用yml配置druid相关的知识,希望对你有一定的参考价值。

spring:
  datasource:
    driver-class-name: com.mysql.jdbc.Driver
    type: com.alibaba.druid.pool.DruidDataSource
    filters: stat
    maxActive: 20
    initialSize: 1
    maxWait: 60000
    minIdle:
    timeBetweenEvictionRunsMillis: 60000
    minEvictionRunsMillis: 300000
    validationQuery: select ‘x‘
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
    maxOpenPreparedStatements: 20

 

以上是关于springboot用yml配置druid的主要内容,如果未能解决你的问题,请参考以下文章