hibernate数据库中文乱码问题解决

这是数据库的字符设置。

在使用hibernate对中文数据进行插入时遇到中文乱码问题只需要在配置文件数据库的URL中添加上下面设置:

jdbc:mysql://localhost:3306/scoermanage?Unicode=true&characterEncoding=UTF-8

在原始的SQL中稍微有点不同:

jdbc:mysql://localhost:3306/scoermanage?useUnicode=true&characterEncoding=UTF-8

猜你喜欢

转载自blog.csdn.net/m0_37224390/article/details/76786795