Chapter 11. Connection Pools and Data Sources
Table of Contents
- Tomcat setup
- Data Sources and JNDI
JDBC 2 introduced standard connection pooling features in an add-on API known as the JDBC 2.0 Optional Package (also known as the JDBC 2.0 Standard Extension). These features have since been included in the core JDBC 3 API.
The JDBC API provides a client and a server interface for connection pooling.
The client interface is
, which is what application code
will typically use to acquire a pooled database connection. The server interface
, which is how most application servers
will interface with the PostgreSQL JDBC driver.
In an application server environment, the application server configuration will
typically refer to the PostgreSQL
while the application component code will typically acquire a
implementation provided by the application server (not by PostgreSQL ).
For an environment without an application server, PostgreSQL provides two
which an application can use directly. One
implementation performs connection pooling, while the other simply provides
access to database connections through the
interface without any
pooling. Again, these implementations should not be used in an application server
environment unless the application server does not support the