Your Ad Here
首页 | 编程语言 | 网站建设 | 游戏天堂 | 冲浪宝典 | 网络安全 | 操作系统 | 软件时空 | 硬件指南 | 病毒相关 | IT 认证
软讯网络 > 软件时空 > 工具软件 > hibernate+mysql的中文问题
【标  题】:hibernate+mysql的中文问题
【关键字】:hibernate+mysql
【来  源】:BLOG.CSDN.NET

hibernate+mysql的中文问题

Your Ad Here

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的字符集

用户自定义标签:【上一篇】
hibernate+mysql的中文问题:【下一篇】
【相关文章】
没有相关文章
【随机文章】
  • 需求分析之数据流图
  • linux上配置ftp服务器 收藏
  • Socket收发邮件--SMTP和POP3
  • javascript 之趣味 函数式编程
  • C语言嵌入式系统编程修炼之六:性能优化
  • 老婆说我“苗条”了!
  • 用flickr 来 spell 你的名字
  • Thread safe tips for python extending
  • 使用wget下载电影
  • Distribution Release: Mayix LiveCD 2006.2
  • 【相关评论】
    没有相关评论
    【发表评论】
    姓名:
    邮件:
    随机码*
    评论*
          
    |  首 页  |  版权声明  |  联系我们   |  网站地图  |
    CopyRight © 2004-2007 bbb软讯网络 All Rigths Reserved.