Use Tomcat JDBC Pool as Hibernate Connection pool

2k views Asked by At

In stand alone application which is build on top of hibernate I like to use Tomcat JDBC Connection Pool.

My guess is that i need to add some configs in hibernate.cfg.xml.

Can someone guide me how to configure hibernate to use "Tomcat JDBC Connection Pool" as connection pool.

1

There are 1 answers

0
Vlad Mihalcea On

In your hibernate.cfg.xml configuration file, you need to set the following property:

hibernate.connection.datasource=java:/comp/env/jdbc/TestDB

assuming this is the JNDI name of your Tomcat CP DataSource.