这是数据库的字符设置。
在使用hibernate对中文数据进行插入时遇到中文乱码问题只需要在配置文件数据库的URL中添加上下面设置:
jdbc:mysql://localhost:3306/scoermanage?Unicode=true&characterEncoding=UTF-8
在原始的SQL中稍微有点不同:
jdbc:mysql://localhost:3306/scoermanage?useUnicode=true&characterEncoding=UTF-8
这是数据库的字符设置。
在使用hibernate对中文数据进行插入时遇到中文乱码问题只需要在配置文件数据库的URL中添加上下面设置:
jdbc:mysql://localhost:3306/scoermanage?Unicode=true&characterEncoding=UTF-8
在原始的SQL中稍微有点不同:
jdbc:mysql://localhost:3306/scoermanage?useUnicode=true&characterEncoding=UTF-8