要的是这个吗?<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD//EN" "http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"><hibernate-configuration> <session-factory> <!-- Don't forget to copy your JDBC driver to the lib/ directory! --> <!-- Settings for a remote Oracle9/10g database.--> <property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property> <property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property> <property name="connection.url">jdbc:oracle:thin:@192.168.0.4:1521:orac</property> <property name="connection.username">test</property> <property name="connection.password">test</property>
<!-- Use the C3P0 connection pool.--> <property name="c3p0.min_size">1</property> <property name="c3p0.max_size">5</property> <property name="c3p0.timeout">600</property> <!-- Use the Hibernate built-in pool for tests. <property name="connection.pool_size">1</property>--> <!-- Use EHCache but not the query cache. --> <property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property> <property name="cache.use_query_cache">false</property> <property name="cache.use_minimal_puts">false</property> <!-- Print SQL to stdout. <property name="show_sql">true</property>--> <!-- Create the tables <property name="hibernate.hbm2ddl.auto">update</property>-->
"-//Hibernate/Hibernate Configuration DTD//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-2.0.dtd"><hibernate-configuration>
<session-factory> <!-- Don't forget to copy your JDBC driver to the lib/ directory! -->
<!-- Settings for a remote Oracle9/10g database.-->
<property name="dialect">net.sf.hibernate.dialect.Oracle9Dialect</property>
<property name="connection.driver_class">oracle.jdbc.driver.OracleDriver</property>
<property name="connection.url">jdbc:oracle:thin:@192.168.0.4:1521:orac</property>
<property name="connection.username">test</property>
<property name="connection.password">test</property>
<!-- Use the C3P0 connection pool.-->
<property name="c3p0.min_size">1</property>
<property name="c3p0.max_size">5</property>
<property name="c3p0.timeout">600</property>
<!-- Use the Hibernate built-in pool for tests.
<property name="connection.pool_size">1</property>--> <!-- Use EHCache but not the query cache. -->
<property name="cache.provider_class">net.sf.ehcache.hibernate.Provider</property>
<property name="cache.use_query_cache">false</property>
<property name="cache.use_minimal_puts">false</property> <!-- Print SQL to stdout.
<property name="show_sql">true</property>--> <!-- Create the tables
<property name="hibernate.hbm2ddl.auto">update</property>-->
<mapping resource="com/happytime/shop/model/Member.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Product.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Category.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Consignee.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Manufacturer.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Order.hbm.xml"/>
<mapping resource="com/happytime/shop/model/OutProduct.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Comment.hbm.xml"/>
<mapping resource="com/happytime/shop/model/Speak.hbm.xml"/>
<mapping resource="com/happytime/shop/model/SpeakCategory.hbm.xml"/>
</session-factory></hibernate-configuration>