软讯网络 > 软件时空 > 工具软件 > hibernate+mysql的中文问题
【标 题】:hibernate+mysql的中文问题
【关键字】:
hibernate+mysql
【来 源】:BLOG.CSDN.NET
hibernate+mysql的中文问题
hibernate+mysql的中文问题
该方法已知适用的版本hiberate3.0 和mysql5.0。
问题描述:
在hibernate的对象中是中文,但是保存到mysql中就变成了乱码。
解决方法:
hibernate的配置文件中加入:
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">UTF-8</property>
另外,mysql的表,字段都应该设成utf-8的字符集
【相关文章】
没有相关文章