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:
- You can specify and configure the datasource right into the hibernate configuration
- You can configure the datasource in the app. server, and specify the corresponding JNDI names in the hibernate configuration. In this case you use the datasource implementation that ships with the app. server.
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.