Hibernate 使用 JNDI 数据源的配置,hibernatejndi,hibernate.cf
分享于 点击 30214 次 点评:24
Hibernate 使用 JNDI 数据源的配置,hibernatejndi,hibernate.cf
hibernate.cfg.xml
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"><hibernate-configuration> <session-factory> <!-- Use a Tomcat JNDI datasource --> <property name="connection.datasource">java:comp/env/jdbc/Sampdb</property> <property name="show_sql">true</property> <property name="dialect">org.hibernate.dialect.MySQLDialect</property> <property name="current_session_context_class">thread</property> <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> <mapping resource="tomcatJndi/Car.hbm.xml"/> <mapping resource="tomcatJndi/Driver.hbm.xml"/> </session-factory></hibernate-configuration>
用户点评