Hibernate / Hibernate interview questions II
How do I lookup application server JNDI DataSource using Hibernate?
For web applications, it is always a good practice to allow servlet container to manage the connection pool. This is the reason we define JNDI resource for DataSource and we look it up in the web application. Hibernate need to used the below property to configure and lookup by JNDI DataSource name.
<property name="hibernate.connection.datasource">java:comp/env/jdbc/myTestDB</property>
More Related questions...