sample application context .xml file
<beans>
<bean id="myDataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName">
<value>java:comp/env/jdbc/myds</value>
</property>
</bean>
<bean id="mySessionFactory" class="org.springframework.orm.hibernate.LocalSessionFactoryBean">
<property name="mappingResources">
<list>
<value>product.hbm.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop>
</property>
<property name="dataSource">
<ref bean="myDataSource">
</ref>
</property>
</bean></beans>
Thursday, 12 June 2008
Configure Hibernate JNDI in Springs
Labels:
hibernate
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment