当前位置:   article > 正文

记录springboot中配置druid数据源sql server的坑 附上配置图_springboot druid sqlserverdriver

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

 

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/我家自动化/article/detail/210880?site
推荐阅读
相关标签
  

闽ICP备14008679号