hibernate保存数据出现乱码
2017-02-24 19:15
162 查看
<?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>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/lilang?useUnicode=true&characterEncoding=gbk</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="javax.persistence.validation.mode">none</property>
<mapping resource="com/hibernate/Student.hbm.xml"/>
</session-factory>
</hibernate-configuration>
<!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>
<!-- Database connection settings -->
<property name="connection.driver_class">com.mysql.jdbc.Driver</property>
<property name="connection.url">jdbc:mysql://localhost/lilang?useUnicode=true&characterEncoding=gbk</property>
<property name="connection.username">root</property>
<property name="connection.password"></property>
<property name="dialect">org.hibernate.dialect.MySQLDialect</property>
<property name="show_sql">true</property>
<property name="format_sql">true</property>
<property name="javax.persistence.validation.mode">none</property>
<mapping resource="com/hibernate/Student.hbm.xml"/>
</session-factory>
</hibernate-configuration>
相关文章推荐
- PHP获取客户端数据保存到MySQL数据库 出现中文乱码解决方案
- Hibernate保存数据自动生成主键出现奇怪异常Duplicate entry '0' for key 1
- hibernate保存数据到mysql时的中文乱码问题
- hibernate保存数据到mysql时的中文乱码问题!
- Hibernate向mysql中保存中文字符出现乱码问题的解决
- 解决:Hibernate 向Mysql插入中文数据乱码,出现???
- mac下 解决 Hibernate保存数据到mysql时的中文乱码问题
- mysql反向生成hbm.xml后,由hibernate向sql写数据中文出现乱码问题
- Hibernate保存数据自动生成主键出现奇怪异常Duplicate entry '0' for key 1
- 使用Hibernate向Mysql中插入中文数据出现乱码
- hibernate保存对象时,数据库出现乱码
- hibernate保存数据到mysql时的中文乱码问题
- hibernate保存时出现乱码
- Hibernate保存数据自动生成主键出现奇怪异常Duplicate entry '0' for key 1
- Hibernate向mysql中保存中文字符出现乱码问题的解决
- hibernate保存对象时,数据库出现乱码
- 解决Hibernate保存数据到mysql时的中文乱码问题
- Hibernate保存对象时,数据库出现乱码
- 使用hibernate传入数据到数据库出现乱码问题解决
- hibernate+mysql保存中文数据乱码问题