Hibernate插入数据库中文乱码

来源:互联网 发布:家庭网络改造设计方案 编辑:程序博客网 时间:2024/05/17 01:02

数据库编码: GB2312

项目编码: UTF-8

解决乱码:

在hibernate.cfg.xml配置文件中配置:

<property name="hibernate.connection.url">

jdbc:mysql://localhost:3306/itcast0201crm?useUnicode=true&amp;characterEncoding=UTF-8

</property>

0 0
原创粉丝点击