Spring database connection Pool c3p0, DBCP, SPRING-JDBC

Source: Internet
Author: User

When using DBCP, add destroy-method= "close" to destroy the method is OK, but with the spring JDBC will be an error message that the Close method is not found this is why?

DBCP

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 2 packages: Commons-dbcp.jar, Commons-pool.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.

Try the following online excerpt not tested:

1 DBCP
DBCP may be the most used open source connection pool, probably because of the ease of configuration, and many examples of open source and Tomcat applications are used for this connection pool.
This connection pool can set the maximum and minimum connections, connection waiting time, etc., basic functions are available. The configuration of this connection pool is described in the attachment compression package: Dbcp.xml
Usage Evaluation: In the specific project application, it is found that the stability of the continuous operation of this connection pool is still possible, but the speed is slightly slower, the stability under the pressure of the large concurrent quantity
The connection pool monitoring is also not available

2 C3P0
C3P0 is another open source connection pool, in the industry is also more famous, this connection pool can set the maximum and minimum connection, connection waiting time, etc., basic functions have.
The configuration of this connection pool is described in the attachment compression package: C3p0.xml.
Use evaluation: In the specific project application, found that the continuous operation of this connection pool stability is quite good, under the pressure of large concurrent volume of stability is also guaranteed,
Connection pool monitoring is also not available.

3 Proxool
Proxool This connection pool may use less people, but also have a certain reputation, this connection pool can be set maximum and minimum connection, connection waiting time, etc., basic functions have.
The configuration of this connection pool is described in the attachment compression package: Proxool.xml.
Usage Evaluation: In a specific project application, it is found that the stability of the continuous operation of this connection pool has some problems, there is a task scenario task that requires a long run of batch, the same code

Spring database connection Pool c3p0, DBCP, SPRING-JDBC

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.