解决Hibernate保存到数据时中文乱码问题
在hibernate.cfg.xml文件中链接属性加入url参数:
<property name="connection.url">
jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=utf-8
</property>
在hibernate.cfg.xml文件中链接属性加入url参数:
<property name="connection.url">
jdbc:mysql://localhost:3306/dbname?useUnicode=true&characterEncoding=utf-8
</property>