Configure hibernate to connect to database via JNDI Datasource
Apparently, you did it right. But here is a list of things you’ll need with examples from a working application: 1) A context.xml file in META-INF, specifying your data source: <Context> <Resource name=”jdbc/DsWebAppDB” auth=”Container” type=”javax.sql.DataSource” username=”sa” password=”” driverClassName=”org.h2.Driver” url=”jdbc:h2:mem:target/test/db/h2/hibernate” maxActive=”8″ maxIdle=”4″/> </Context> 2) web.xml which tells the container that you are using this resource: <resource-env-ref> … Read more