hibernate插入数据库乱码解决方案

来源:互联网 发布:简历生活照怎么照之乎 编辑:程序博客网 时间:2024/05/20 21:48

1.修改数据库编码utf-8
2.需要修改hibernate的配置文件hibernate.cfg.xml
<property name="connection.url">
<![CDATA[jdbc:mysql://localhost:3306/****?useUnicode=true&characterEncoding=utf8]]>
</property>

把*替换为自己的数据库名字

0 0
原创粉丝点击