I am implementing connection pooling in project. Performance wise which is better approach to do it?
- Hibernate (using C3PO or DBCP)
- Configuring JDBC data-source in Application server.
Application server Portability is not an important factor for me. Please suggest the approach.
that depends whether your 'application' server supports pooling. for example, tomcat doesn't (as it's not a proper app server), but glassfish does. as an aside, i personally have found c3po much better than dbcp, but it's worth testing them both in your environment.
Connection pooling is implemented in the DataSource, and in both case Hibernate will use a datasource.
The question is which data source implementation is used, and how is it configured:
Performance-wise, I think the implementation has little impact -- it's more whether you want your
.war
to be dependent on resources managed by the app. server (case 2) or not (case 1). In case 1, prefer C3P0 to DBCP though.