1.确认数据库及数据表的编码格式为utf8
2.确认javaweb项目的编码格式为utf-8
3.将hibernate.cfg.xml中连接数据库的配置改为
<property name="hibernate.connection.url">
jdbc:mysql:///hibernate_day01?useUnicode=true&characterEncoding=utf-8
</property>
1.确认数据库及数据表的编码格式为utf8
2.确认javaweb项目的编码格式为utf-8
3.将hibernate.cfg.xml中连接数据库的配置改为
<property name="hibernate.connection.url">
jdbc:mysql:///hibernate_day01?useUnicode=true&characterEncoding=utf-8
</property>