Skip to content
SallyB edited this page Dec 3, 2017 · 26 revisions

English | 中文

FAQ

1. What is Druid?

Druid is one the best database connection pools written in JAVA. Druid provides powerful monitoring functionalities and more.

2. Where to download?

3. how to get the source code

Druid is an open source project which is hosted on Github, source code repository: https://github.com/alibaba/druid

4. maven config

since 0.1.18, druid has been deployed to the maven central repository. Add the dependency to the pom.xml, such as:

	<dependency>
		<groupId>com.alibaba</groupId>
		<artifactId>druid</artifactId>
		<version>${druid-version}</version>
	</dependency>

5. how to use Druid's monitoring feature?

Druid monitoring feature is implemented by filter-chain. To turn it on, config StatFilter, example: https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatFilter

6. how to use Druid buit-in monitoring page

built-in monitoring page is a Servlet, configuration see here : https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatViewServlet%E9%85%8D%E7%BD%AE

7. how to configure Web and Spring related monitoring?

8. how to configure the defense against SQL injection attacks

Druid provides WallFilter, it is based on the SQL semantic analysis to defense SQL injection attacks, reference : https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE-wallfilter

9. DruidDataSource reference configuration

different needs of different business scenarios, you can use our reference configuration, but it is recommended that you carefully read the documentation to understand clearly do custom configuration.

https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_DruidDataSource%E5%8F%82%E8%80%83%E9%85%8D%E7%BD%AE

10. I would like to log SQL execution trace, how to config?

Druid provides Log4jFilter/CommonsLogFilter/Slf4jFilter, see here : https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_LogFilter

11. my program may be have connection leaks, how to do?

Druid offers a variety of means to monitoring connection leaks, see here : https://github.com/alibaba/druid/wiki/%E8%BF%9E%E6%8E%A5%E6%B3%84%E6%BC%8F%E7%9B%91%E6%B5%8B

12. Solve the problem of excessive memory footprint Oracle PSCache

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

13. Druid and other connection pool comparison?

14. what to pay attention to migration from other connection pool?

15. Similar Jboss DataSource ExceptionSorter in Druid

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

16. why maxIdle properties is useless?

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.

17. To use DruidDataSource in JNDI?

DruidDataSource support JNDI, see here : http://code.alibabatech.com/wiki/pages/viewpage.action?pageId=2916633
the concrete implementation of the class is this : com.alibaba.druid.pool.DruidDataSourceFactory, you can read the code to deep understanding.

18. How to replace DBCP with Druid?

It is very easy to migrate from DBCP to Druid.

In this usage, making Druid can be used in existing applications such as sonar, sonar is web application written in ruby, write dead DBCP, only through this method to replace.

19. I'd like try a version of snapshots, how to do?

see here : http://code.alibabatech.com/mvn/snapshots/com/alibaba/druid/

20. Some SQL execution is very slow, and I hope that a log record, how to do?

In StatFilter slow SQL execution logging configuration, see here : https://github.com/alibaba/druid/wiki/%E9%85%8D%E7%BD%AE_StatFilter

21. I want to encrypt the database password, how to do?

DBA does not want to directly write the password in the config file, Druid provide the features that encrypted database password. see here : https://github.com/alibaba/druid/wiki/%E4%BD%BF%E7%94%A8ConfigFilter

22. How to participate in the development of Druid?

Druid is an open source project, hosted on github.com, you can "pull request". see here : https://github.com/alibaba/druid/wiki/%E5%A6%82%E4%BD%95%E5%8F%82%E4%B8%8E

23. Welcome discuss and improvement !

(Welcome to join QQ Group: 240619787 for discuss and study Druid)

24. How to integrate the Druid connection pool and monitoring in Spring Boot project?

Usage Druid Spring Boot Starter,Documentation:https://github.com/alibaba/druid/tree/master/druid-spring-boot-starter

25. How to add custom WallConfig, Filter in the Spring Boot ?

https://github.com/alibaba/druid/blob/master/druid-spring-boot-starter/README_EN.md#how-to-configuration--filter

Clone this wiki locally