JDBC Tutorials - Herong's Tutorial Examples - v3.14, by Herong Yang
What Is Database Connection Pool
This section provides a quick introduction on database connection pool, which is an object container managing a set of JDBC connection objects to be reused to avoid repeated connection opening and closing operations.
What Is Database Connection Pool? - A Database Connection Pool is an object container that manages a set of JDBC connection objects to be reused to avoid repeated connection opening and closing operations.
There two main situations where you should consider using JDBC pooled connections:
The JDBC API 3.0 and newer versions provide a general interface for connection pooling with 3 primary classes:
The actual implementation of the Connection Pool interface will be done by JDBC drivers or third party libraries.
Commonly used third party Connection Pool libraries are:
Commons DBCP - A JDBC database connection pool library developed by Apache See Commons DBCP Website at https://commons.apache.org/proper/commons-dbcp.
C3P0 - A mature and highly concurrent JDBC Connection pooling library developed by Steve Waldman. See C3P0 GitHub Website at https://github.com/swaldman/c3p0.
Table of Contents
JDBC (Java Database Connectivity) Introduction
Installing and Running Derby (Java DB)
Derby (Java DB) JDBC DataSource Objects
Derby (Java DB) - DML Statements
Derby (Java DB) - ResultSet Objects of Queries
Derby (Java DB) - PreparedStatement
Summary of JDBC Drivers and Database Servers
►Using Connection Pool with JDBC
►What Is Database Connection Pool
Commons DBCP for Connection Pooling
Connection Pooling with Commons DBCP BasicDataSource
Connection Pooling with Commons DBCP PoolingDriver
Connection Pooling with C3P0 ComboPooledDataSource