首先使数据库的编码方式为utf-8,然后在使用jdbc连接数据库时下如下这样写即可: jdbc:mysql://localhost:3306/storedb?useUnicode=true&characterEncoding=utf-8