spring:
  datasource:
    url: jdbc:sqlserver://192.168.0.189:1433;DatabaseName=test001
    driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver
    username: ljt
    password: ljt123!
    type: com.alibaba.druid.pool.DruidDataSource
    #   数据源其他配置
    initialSize: 5
    minIdle: 5
    maxActive: 20
    maxWait: 60000
    timeBetweenEvictionRunsMillis: 60000
    minEvictableIdleTimeMillis: 300000
    #每个数据库都不一样的 注意要
    validationQuery: SELECT 1
    testWhileIdle: true
    testOnBorrow: false
    testOnReturn: false
    poolPreparedStatements: true
    #   配置监控统计拦截的filters,去掉后监控界面sql无法统计,'wall'用于防火墙
    filters: stat,wall,log4j
    maxPoolPreparedStatementPerConnectionSize: 20
    useGlobalDataSourceStat: true
    #慢SQL记录 如果上面validationQuery: SELECT 1 没有配置,而你配置了就会报错null
    connectionProperties: druid.stat.mergeSql=true;druid.stat.slowSqlMillis=500

 

GitHub 加速计划 / druid / druid
5
3
下载
阿里云计算平台DataWorks(https://help.aliyun.com/document_detail/137663.html) 团队出品,为监控而生的数据库连接池
最近提交(Master分支:8 个月前 )
1aea5ae6 * fix subquery and tableExpr inside 'from' of 'update statement' * add dbtype adb_mysql * preserve owner of allColumnExpr in cloneto 2 个月前
b043fd17 2 个月前
Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐