-
Notifications
You must be signed in to change notification settings - Fork 8.6k
FAQ
Welcome everyone to use Druid, FAQ answers here, we want to help.
Druid is the best in the java language database connection pool. Druid to provide a powerful monitoring and extended functionality.
-
released version download:
github downloads : https://github.com/AlibabaTech/druid/downloads
maven central repository: http://central.maven.org/maven2/com/alibaba/druid/
Alibaba open source repository: http://code.alibabatech.com/mvn/releases/com/alibaba/druid/ -
snapshots versions
http://code.alibabatech.com/mvn/snapshots/com/alibaba/druid/
Driud is an open source project, hosting on github, source code repository: https://github.com/AlibabaTech/druid
since 0.1.18, druid deploy to maven central repository, so you only need to add the dependency to the pom.xml, such as:
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>druid</artifactId>
<version>${druid-version}</version>
</dependency>
Druid monitoring feature is implementation by filter-chain, if you want turn on, config StatFilter, look here : https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_StatFilter
built-in monitoring page is a Servlet, configuration see here : https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_StatViewServlet%E9%85%8D%E7%BD%AE
- Web related monitoring config
https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_%E9%85%8D%E7%BD%AEWebStatFilter - Spring related monitoring config
https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_Druid%E5%92%8CSpring%E5%85%B3%E8%81%94%E7%9B%91%E6%8E%A7%E9%85%8D%E7%BD%AE
Druid provides WallFilter, it is based on the SQL semantic analysis to defense SQL injection attacks, see here : http://code.alibabatech.com/wiki/display/Druid/WallFilterConfig
different needs of different business scenarios, you can use our reference configuration, but it recommended that you carefully read the documentation to understand clearly do custom configuration.
Druid provides Log4jFilter/CommonsLogFilter/Slf4jFilter, see here : https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_LogFilter
Druid offers a variety of means to monitoring connection leaks, see here : https://github.com/AlibabaTech/druid/wiki/%E8%BF%9E%E6%8E%A5%E6%B3%84%E6%BC%8F%E7%9B%91%E6%B5%8B
Connect to an Oracle database, other connection pool will exist the problem of excessive memory usage, Druid is the only connection pool to solve this problem. see here : http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6951277
- A variety of connection pool against : http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6951797
- comparison of various connection pool parameters: http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6947005
- migration from DBCP : http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=6950500
ExceptionSorter is one of the outstanding features of JBoss DataSource, Druid has the same funtion of ExceptionSorter, but do not have to manually configure it take effect automatically. see here : http://code.alibabatech.com/wiki/display/Druid/ExceptionSorter
the maxIdle property for Druid compatible with DBCP, maxIdle is a confusing concept. the connection pool should only maxPoolSize and minPoolSize,druid retain only maxActive and minIdle, respectively the equivalent maxPoolSize and minPoolSize.
DruidDataSource support JNDI, see here : http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=2916633
具体实现的类是这个:com.alibaba.druid.pool.DruidDataSourceFactory,你可以阅读代码加深理解。
可以的,Druid提供了一个中完全平滑迁移DBCP的办法。
-
- 从https://github.com/AlibabaTech/druid-wrapper/downloads 下载druid-wrapper-0.0.1-SNAPSHOT.jar
- 从https://github.com/AlibabaTech/druid-wrapper/downloads 下载druid-wrapper-0.0.1-SNAPSHOT.jar
-
- 加入druid-xxx.jar
- 加入druid-xxx.jar
-
- 从你的WEB-INF/lib/中删除dbcp-xxx.jar
- 从你的WEB-INF/lib/中删除dbcp-xxx.jar
-
- 按需要加上配置,比如JVM启动参数加上-Ddruid.filters=stat,动态配置druid的filters
- 按需要加上配置,比如JVM启动参数加上-Ddruid.filters=stat,动态配置druid的filters
这种用法,使得可以在一些非自己开发的应用中使用Druid,例如在sonar中部署druid,sonar是一个使用jruby开发的web应用,写死了DBCP,只能够通过这种方法来更换。
直接获取快照版本的地址是:http://code.alibabatech.com/mvn/snapshots/com/alibaba/druid/ ,使用快照版本建议加入我们QQ群 92748305,遇到问题直接反馈给我们。
在StatFilter配置中有慢SQL执行日志记录,看这里 https://github.com/AlibabaTech/druid/wiki/%E9%85%8D%E7%BD%AE_StatFilter
运维和DBA都不希望把密码明文直接写在配置文件中,Druid提供了数据库秘密加密的功能。具体看这里:https://github.com/AlibabaTech/druid/wiki/%E4%BD%BF%E7%94%A8ConfigFilter
Druid是一个通过github开源的项目,github的特性,使得你很容易参与其中。这里有详细说明 https://github.com/AlibabaTech/druid/wiki/%E5%A6%82%E4%BD%95%E5%8F%82%E4%B8%8E