【druid 】数据库连接池

一、数据库连接池架构

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

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


druid.filters.default=com.alibaba.druid.filter.stat.StatFilterdruid.filters.stat=com.alibaba.druid.filter.stat.StatFilterdruid.filters.mergeStat=com.alibaba.druid.filter.stat.MergeStatFilterdruid.filters.counter=com.alibaba.druid.filter.stat.StatFilterdruid.filters.encoding=com.alibaba.druid.filter.encoding.EncodingConvertFilterdruid.filters.log4j=com.alibaba.druid.filter.logging.Log4jFilterdruid.filters.log4j2=com.alibaba.druid.filter.logging.Log4j2Filterdruid.filters.slf4j=com.alibaba.druid.filter.logging.Slf4jLogFilterdruid.filters.commonlogging=com.alibaba.druid.filter.logging.CommonsLogFilterdruid.filters.commonLogging=com.alibaba.druid.filter.logging.CommonsLogFilterdruid.filters.wall=com.alibaba.druid.wall.WallFilterdruid.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

相关文章