Specifically, when I return a connection to the pool, does dbcp (and other connection pools) close the statements and resultsets for me?
Or should I be closing these myself?
The connection user name to be passed to our JDBC driver to establish a connection. The connection password to be passed to our JDBC driver to establish a connection. The connection URL to be passed to our JDBC driver to establish a connection. The fully qualified Java class name of the JDBC driver to be used.
This Commons package provides an opportunity to coordinate the efforts required to create and maintain an efficient, feature-rich package under the ASF license. The commons-dbcp2 artifact relies on code in the commons-pool2 artifact to provide the underlying object pool mechanisms.
Using connection pools helps to both alleviate connection management overhead and decrease development tasks for data access. Each time an application attempts to access a backend store (such as a database), it requires resources to create, maintain, and release a connection to that datastore.
Via the JDBC resource, the application gets a database connection. Behind the scenes, the application server retrieves a physical connection from the connection pool that corresponds to the database. The pool defines connection attributes such as the database name (URL), user name, and password.
OK I see that statements are closed by dbcp in DelegatingConnection.passivate() and DelegatingStatement.close() closes the resultsets.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With