Commons DBCP for Connection Pooling

This section provides a quick introduction on Commons DBCP, which is a popular open source JDBC database connection pool library developed by Apache.

Commons DBCP is a popular open source JDBC database connection pool library developed by Apache. Here is what I did to download Commons DBCP on my local computer.

1. Go to Commons DBCP Website at https://commons.apache.org/proper/commons-dbcp.

2. Click "Downloads" link and download "commons-dbcp2-2.8.0-bin.zip".

3. Unzip the download file to get the JAR file:

commons-dbcp2-2.8.0/
  207774 Jan 22  2020 commons-dbcp2-2.8.0.jar

According to the documentation, we have 3 options to create a connection pool with Commons DBCP:

1. Using org.apache.commons.dbcp2.BasicDataSource class, which implements the standard JDBC javax.sql.DataSource interface to manage the connection pool with JavaBean style properties.

2. Using org.apache.commons.dbcp2.PoolingDataSource class, which implements the standard JDBC javax.sql.DataSource interface to manage the connection pool with a manually created object pool.

3. Using org.apache.commons.dbcp2.PoolingDriver class, which implements the standard JDBC javax.sql.Driver interface to manage the connection pool with a custom JDBC driver.

To use Commons DBCP 2.8.0, you also need to download 2 more Apache Java packages:

Table of Contents

 About This Book

 JDBC (Java Database Connectivity) Introduction

 JDK (Java SE) Installation

 Installing and Running Java DB - Derby

 Derby (Java DB) JDBC Driver

 Derby (Java DB) JDBC DataSource Objects

 Java DB (Derby) - DML Statements

 Java DB (Derby) - ResultSet Objects of Queries

 Java DB (Derby) - PreparedStatement

 MySQL Installation on Windows

 MySQL JDBC Driver (MySQL Connector/J)

 MySQL - PreparedStatement

 MySQL - Reference Implementation of JdbcRowSet

 MySQL - JBDC CallableStatement

 MySQL CLOB (Character Large Object) - TEXT

 MySQL BLOB (Binary Large Object) - BLOB

 Oracle Express Edition Installation on Windows

 Oracle JDBC Drivers

 Oracle - Reference Implementation of JdbcRowSet

 Oracle - PreparedStatement

 Oracle - JBDC CallableStatement

 Oracle CLOB (Character Large Object) - TEXT

 Oracle BLOB (Binary Large Object) - BLOB

 Microsoft SQL Server Express Edition

 Microsoft JDBC Driver for SQL Server

 Microsoft JDBC Driver - Query Statements and Result Sets

 Microsoft JDBC Driver - DatabaseMetaData Object

 Microsoft JDBC Driver - DDL Statements

 Microsoft JDBC Driver - DML Statements

 SQL Server - PreparedStatement

 SQL Server CLOB (Character Large Object) - TEXT

 SQL Server BLOB (Binary Large Object) - BLOB

 JDBC-ODBC Bridge Driver - sun.jdbc.odbc.JdbcOdbcDriver

 JDBC-ODBC Bridge Driver - Flat Text Files

 JDBC-ODBC Bridge Driver - MS Access

 JDBC-ODBC Bridge Driver - MS SQL Server

 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

 C3P0 for Connection Pooling

 Connection Pooling with C3P0 ComboPooledDataSource

 Connection Pooling with C3P0 DataSources

 Archived Tutorials

 References

 Full Version in PDF/EPUB