Hibernate自动生成数据表后,里面数据乱码问题
<?xmlversion="1.0"encoding="UTF-8"?>
<!DOCTYPEhibernate-configurationPUBLIC"-//Hibernate/HibernateConfigurationDTD3.0//EN""http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<!--配置方言-->
<propertyname="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
<!--配置数据库驱动类-->
<propertyname="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
<!--数据库访问路径-->
<propertyname="hibernate.connection.url">jdbc:mysql://127.0.0.1:3306/hibernate?useUnicode=true&characterEncoding=UTF-8</property>
<!--用户名-->
<propertyname="hibernate.connection.username">root</property>
<!--密码-->
<propertyname="hibernate.connection.password"></property>
<propertyname="hbm2ddl.auto">update</property>
<!--是否在控制台显示产生的SQL语句信息-->
<propertyname="show_sql">true</property>
<!--管理加载映射文件-->
<mappingresource="com/shxt/model/User.hbm.xml"/>
</session-factory>
</hibernate-configuration>