Common Database Connection Pools

Source: Internet
Author: User
Tags connection pooling

Now common open source database connection pool mainly has c3p0, DBCP, proxool three kinds, among them:
Spring recommends the use of DBCP;
Hibernate recommends the use of c3p0 and proxool;
1, Dbcp:apache
DBCP (Database connection pool) DB connection pool. is a Java Connection pool project on Apache and a connection pool component used by Tomcat. Use of DBCP alone requires 3 packages: Common-dbcp.jar,common-pool.jar, Common-collections.jar because establishing a database connection is a very time-consuming and resource-intensive behavior, the connection pool is pre-established with the database to make some connections, put in memory, the application needs to establish a database connection directly to the connection pool to apply for a line, run out and then put back. The DBCP does not automatically recycle the idle connection function.

2, C3P0:
C3P0 is an open source JDBC connection pool that implements the data source and Jndi bindings, and supports the standard extensions of the JDBC3 specification and JDBC2. C3P0 are asynchronous operations, and slow JDBC operations are done by helping the process. Extending these operations can effectively improve performance. The open source projects that currently use it are hibernate,spring and so on. The C3P0 has auto-recycle idle connection function.

3, Proxool:sourceforge
Proxool is a Java database connection pooling technique. is an open source project under SourceForge, this project provides a robust, easy-to-use connection pool, the most critical of which is the ability to provide monitoring, easy to use, easy to find the connection leakage situation.
Contrast:
1> the same amount of threads and cycles in the same time: compare the three iconic performance test parameters (Average,median,90%line) for three connection pools and discover: Performance dbcp<=c3p0<proxool;
2> test of the same database connection pool under different circumstances: by observing the Average,median,90%line three parameters, a
Now the stability of three connection pools (the change of three test parameters of three connection pools) in order: stability Dbcp>=c3p0>proxool.
Conclusion:
By testing the performance of three database connection pools, Proxool and c3p0 are better able to support high concurrency, but the stability is slightly inferior to DPCP;

Common Database Connection Pools

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.