java - Is DBCP (Apache Commons Database Connection Pooling) still relevant? -


JDBC 3.0 Space Talk about connection (and prepared statement) pooling.

We have several standalone Java programs (i.e. we are not using an application server) that are using DBCP to provide connections pooling. Should we continue to use DBCP, or can we take advantage of the pooling provided by JDBC and get rid of DBC?

We are using MySQL (Connector / J) and eventually support SQL Server (JTDS); It is not possible that we will support any other database.

Edit: See the comment below about your efforts to eliminate the connection pooling library. It appears that DBCCP is still relevant (note that some commentators recommend C3P on DBCCP )

For the promotion of other posters, I use the MySQL JDBC driver to eliminate DBCP Tried (Connector / J 5.0.4). I was unable to do this.

It seems that when the driver provides the foundation of pooling, then it does not provide the most important thing: a real pool (source code came into this work) to provide this part to the applications Is left on the server.

I took a look at the JDBC 3.0 documentation (I have a printed copy of something called "Chapter 11 Connection pooling", not sure where it came from) and I can see that MySQL The driver is following the JDBC doctor.

When I look at DBCP, then this decision begins to understand. Good pool management offers many options, for example, when you clean the unused connection? Which connections do you purify? Is there a hard or soft limit on the maximum number of connections in the pool? Should you test the connection for "lava" before giving it to a collar? e.t.c.

Summary: If you are making a standalone Java application, you must use a connection pooling library. Connection pooling libraries are still relevant.


Comments