1.MySQL数据库编码设为UTF-8
2.Myeclipse编码格式
右键项目→Properties→Resource
3.Hibernate配置文件.xml
<property name="url" value="jdbc:mysql://localhost:3306/aimage?useUnicode=true&characterEncoding=utf8"></property>
数据库名称?useUnicode=true &characterEncoding=utf8
(有些是"&"不能用的)