日期:2014-05-16  浏览次数:20507 次

数据库配置文件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>      
    <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
    <property name="hibernate.connection.url">
      jdbc:mysql://10.12.30.97:3306/nes1_1?useUnicode=true&amp;characterEncoding=utf-8&amp;zeroDateTimeBehavior=convertToNull&amp;transformedBitIsBoolean=true
    </property>
    <property name="hibernate.connection.username">nes</property>
    <property name="hibernate.connection.password">nes</property>
    <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect </property>
    <property name="hibernate.show_sql">true</property>
    <property name="hibernate.hbm2ddl.auto">update</property> 
        
    <mapping resource="./Question.hbm.xml" />
    <mapping resource="./QuestionBank.hbm.xml" />
    <mapping resource="./QuestionOptions.hbm.xml" />
  </session-factory>
</hibernate-configuration>