JDBC Tutorials - Herong's Tutorial Examples - v3.12, by Dr. 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 Java DB - Derby
Derby (Java DB) JDBC DataSource Objects
Java DB (Derby) - DML Statements
Java DB (Derby) - ResultSet Objects of Queries
Java DB (Derby) - PreparedStatement
MySQL JDBC Driver (MySQL Connector/J)
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 - Reference Implementation of JdbcRowSet
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
Connection Pooling with C3P0 ComboPooledDataSource