hibernate,mysql中文乱码解决方法
2009-08-28 12:23
501 查看
首先保证整个项目使用统一的编码如gb2312或utf8,在这里我使用的数据库为mysql,安装时设置为utf8编码,gb2312也成,然后在
hibernate.cfg.xml文件中设置你所使用的编码:
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">utf8</property>
或在设置数据库连接时采用如:
<property name="connection.url">jdbc:mysql://localhost:3306/db_group?useUnicode=true&characterEncoding=UTF-8</property>
的方式
hibernate.cfg.xml文件中设置你所使用的编码:
<property name="connection.useUnicode">true</property>
<property name="connection.characterEncoding">utf8</property>
或在设置数据库连接时采用如:
<property name="connection.url">jdbc:mysql://localhost:3306/db_group?useUnicode=true&characterEncoding=UTF-8</property>
的方式
相关文章推荐
- hibernate 和 mysql 中文显示乱码解决方法
- Mysql中文乱码的解决方法
- Mac OS环境下Java连接MySql中文乱码解决方法
- 解决jsp+MysQL输入和输出中文乱码的方法!
- 解决hibernate向mysql插入中文乱码问题
- mysql中文乱码解决方法
- R 从mysql读取数据中文乱码的解决方法
- mysql 中文乱码解决方法集锦
- jsp中文乱码 jsp mysql 乱码的解决方法
- jsp存取mysql中文数据结果为乱码的解决方法(未经验证)
- mysql 1366错误,保存中文乱码的解决方法
- 解决hibernate向mysql插入中文乱码
- mysql导入导出数据中文乱码解决方法小结
- MySql 学习系列之中文乱码解决方法总结
- 解决mysql中文乱码的最根本的方法
- MySQL添加中文查询结果在乱码的解决方法
- cmd中MySQL中文数据乱码问题解决方法
- mysql插入表中的中文显示为乱码或问号的解决方法
- JAVA写入Mysql中文乱码解决方法
- php mysql 中文乱码解决方法