Skip to main content

Posts

Showing posts from July, 2009

Connection Pooling Concepts

Connection Pooling If you do not use connection pooling, each connection instance ( java.sql.Connection or oracle.jdbc.OracleConnection instance) encapsulates its own physical database connection. When you call the close() method of the connection instance, the physical connection itself is closed. This is true whether you obtain the connection instance through the JDBC 2.0 data source facility described under " Data Sources ", or through the DriverManager facility described under " Open a Connection to a Database ". With connection pooling, an additional step allows physical database connections to be reused by multiple logical connection instances, which are temporary handles to the physical connection. Use a connection pool data source to return a pooled connection, which is what encapsulates the physical database connection. Then use the pooled connection to return JDBC connection instances (one at a time) that each act as a temporary handle. Closing a connect