top of page

Database connection pool for Java



1. Purpose of Database connection pool

Main purpose is to create db connections and keep them in the pool and we can reuse them whenever our application code need to execute the queries to db.

Because the creation of connections to db is a very costly operation, Connection pooling allows us to save that effort.

 

2. Typical database connection life cycle

  • Opening a connection to the database using the database driver

  • Opening a TCP socket for reading/writing data

  • Reading / writing data over the socket

  • Closing the connection

  • Closing the socket

 

3. Some of JDBC Connection Pooling Frameworks

  • Apache Commons DBCP (https://commons.apache.org/proper/commons-dbcp/)

  • HikariCP (https://github.com/brettwooldridge/HikariCP)

  • C3PO (https://www.mchange.com/projects/c3p0/index.html)

  • Druid (https://github.com/alibaba/druid/wiki/FAQ)

  • Tomcat (https://tomcat.apache.org/tomcat-9.0-doc/jdbc-pool.html)

  • BoneCP (https://jolbox.com/)

Single post: Blog_Single_Post_Widget
bottom of page