hibernate的数据库乱码问题

<?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 name="">
  <property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
  <!-- 解决中文乱码问题:使用"?useUnicode=true&amp;characterEncoding=UTF-8",不可分行书写 -->
  <property name="hibernate.connection.url">
   jdbc:mysql://localhost:3306/pf?useUnicode=true&amp;characterEncoding=UTF-8
  </property>
  <property name="hibernate.connection.username">opfo</property>
  <property name="hibernate.connection.password">opfo.cn</property>
  <property name="hibernate.connection.pool_size">5</property>
  <property name="hibernate.dialect">org.hibernate.dialect.MySQL5InnoDBDialect</property>
  <property name="hbm2ddl.auto">update</property>
  <property name="show_sql">true</property>
  <property name="hibernate.show_sql">true</property>
  <mapping resource="cn/opfo/app/domain/Person.hbm.xml" />
 </session-factory>
</hibernate-configuration>

上一篇:U3D物理碰撞总结


下一篇:CSS(3)多种方法实现水平垂直居中效果