Java connection pool implementation principle

Java connection pool implementation principle

1. The connection pool manager is responsible for managing connections.
2. When the connection pool is instantiated, the relevant connection is created and placed in the connection pool.
3. When the application uses the connection, it directly obtains a connection from the connection pool, and returns it to the connection pool when it is used up.
4. After the connection is disconnected, the connection pool manager will create a new connection.
5. The disconnection will inevitably happen abnormally.


The purpose of the connection pool:
1. Reduce the time for the application to connect each time it is used (it takes time to establish a connection (TCP)) and improve efficiency.


Reference original text: http://www.cnblogs.com/java-boy/archive/2011/03/18/1987786.html

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326980933&siteId=291194637