Druid is a JDBC component that includes three parts:
Druiddriver Agent driver, can provide the plug-in system based on Filter-chain mode.
Druiddatasource Efficient and manageable database connection pool.
Sqlparser
What Druid can do.
1 can monitor the performance of database access, Druid built-in provides a powerful Statfilter plug-in, can be detailed statistics of the execution performance of SQL, this for online analysis of database access performance is helpful.
2) Replace DBCP and C3P0. Druid provides an efficient, powerful, scalable database connection pool.
3 Database Password encryption. Writing the database password directly in the configuration file is bad behavior and can lead to security problems. Druiddruiver and Druiddatasource both support PasswordCallback.
4 SQL Execution Log, Druid provides a variety of logfilter, can support common-logging, log4j and Jdklog, you can choose the appropriate logfilter as needed, monitor your application database access.
To extend JDBC, if you want to have programming requirements for the JDBC layer, you can easily write the JDBC layer extensions through the Filter-chain mechanism provided by Druid.
The following is a monitoring implementation based on the Druid built-in extension statfilter:
Druid's JAVADOC documentation please see