先检查数据库的字符集,单击数据库中的表,点击 设计表,点击任意字段并查看字符集
一般是这样就可以的,没有问题。
然后呢我的解决办法是通过在hibernate.cfg.xml文件中的
<property name="hibernate.connection.url">
<[CDATA[jdbc:mysql://localhost:3306/hibernateuseUnicode=true&characterEncoding=utf8]]>
</property>
url改为 <![CDATA[jdbc:mysql://localhost:3306/hibernate?useUnicode=true&characterEncoding=utf8]]>
这样我的问题就解决了
做个笔记