DBCP Connection Pooling Example
DBCP Connection Pooling Example exaplains about how to create and configure a Connection pool using DBCP Datasource
Many Apache projects support interaction with a relational database, DBCP one among them.
Creating a new connection for each user can be time consuming (often requiring multiple seconds of clock time), in order to perform a database transaction that might take milliseconds. Opening a connection per user can be unfeasible in a publicly-hosted Internet application where the number of simultaneous users can be very large. Accordingly, developers often wish to share a "pool" of open connections between all of the application's current users.
The number of users actually performing a request at any given time is usually a very small percentage of the total number of active users, and during request processing is the only time that a database connection is required. The application itself logs into the DBMS, and handles any user account issues internally
Reference -> http://commons.apache.org/proper/commons-dbcp/