码迷,mamicode.com
首页 > 数据库 > 详细

【druid 】数据库连接池

时间:2019-04-21 20:26:26      阅读:423      评论:0      收藏:0      [点我收藏+]

标签:过滤   open   counter   slice   返回   lap   count   enc   span   

一、数据库连接池架构

技术图片

二、数据库连接池的过滤器

spi的思想,加载配置文件的Filter

技术图片
druid.filters.default=com.alibaba.druid.filter.stat.StatFilter
druid.filters.stat=com.alibaba.druid.filter.stat.StatFilter
druid.filters.mergeStat=com.alibaba.druid.filter.stat.MergeStatFilter
druid.filters.counter=com.alibaba.druid.filter.stat.StatFilter
druid.filters.encoding=com.alibaba.druid.filter.encoding.EncodingConvertFilter
druid.filters.log4j=com.alibaba.druid.filter.logging.Log4jFilter
druid.filters.log4j2=com.alibaba.druid.filter.logging.Log4j2Filter
druid.filters.slf4j=com.alibaba.druid.filter.logging.Slf4jLogFilter
druid.filters.commonlogging=com.alibaba.druid.filter.logging.CommonsLogFilter
druid.filters.commonLogging=com.alibaba.druid.filter.logging.CommonsLogFilter
druid.filters.wall=com.alibaba.druid.wall.WallFilter
druid.filters.config=com.alibaba.druid.filter.config.ConfigFilter
View Code

 

三、druid连接池返回的连接其实是包装类

com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl

com.alibaba.druid.pool.DruidPooledConnection

 

 

参考:https://www.jianshu.com/p/3f2401d14c78

https://www.jianshu.com/p/4df8d4019055

【druid 】数据库连接池

标签:过滤   open   counter   slice   返回   lap   count   enc   span   

原文地址:https://www.cnblogs.com/shangxiaofei/p/10746302.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!