February 19, 2008

Hibernate 3.0 config file with JNDI datasource


<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">

<hibernate-configuration>
<session-factory>

<!-- Properties -->
<property name="dialect">org.hibernate.dialect.DB2Dialect</property>
<property name="connection.datasource">jdbc/my jndi name</property>
<property name="show_sql">true</property>
<property name="default_schema">COMMERCIAL</property>

<!-- Mapping files -->
<mapping resource="com/myCompany/myApp/mappings/Auto.hbm.xml"/>
<mapping resource="com/myCompany/myApp/mappings/Building.hbm.xml"/>
<mapping resource="com/myCompany/myApp/mappings/AuditLog.hbm.xml"/>

</session-factory>
</hibernate-configuration>

No comments: