hibernate 5 与 mysql 5.4 以上 版本的 坑

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
                                         "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
 <session-factory>
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <property name="hibernate.connection.password">123456</property>
  <property name="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/mvc</property>
  <property name="hibernate.connection.username">root</property>
  <!-- mysql5.4 以上版本专有 -->
  <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
  <property name="hibernate.show_sql">true</property>
  <property name="hibernate.format_sql">true</property>
  <property name="hibernate.hbm2ddl.auto">update</property>
  <!-- 不要默认的 class -->
  <mapping  resource="com/jingshan/model/Student.hbm.xml"/>
 </session-factory>
</hibernate-configuration>


猜你喜欢

转载自blog.csdn.net/wtyicy/article/details/80410249
今日推荐