java - Mybatis插入数据乱码问题?
ringa_lee
ringa_lee 2017-04-17 15:49:00
0
2
376

   


系统采用springMVC+Mybatis,在web.xml已经配置成如图:

并且Mysql中编码都统一了

jsp传到后台的属性打印出来是正常的,只是在通过mybatis中的xml执行sql插入报错,求大神指教!!!

ringa_lee
ringa_lee

ringa_lee

reply all (2)
Peter_Zhu

Add &characterEncoding=utf8 to the url in the data source (mysql) configuration. The specific url can be found in value="jdbc:mysql://127.0.0.1:3306/material?useUnicode=true&characterEncoding=utf8&autoReconnect=true". Ensure that requests and responses, page and database layer operations maintain UTF-8 encoding

    黄舟

    Are the database schema and table encoding format not set?

      Latest Downloads
      More>
      Web Effects
      Website Source Code
      Website Materials
      Front End Template
      About us Disclaimer Sitemap
      php.cn:Public welfare online PHP training,Help PHP learners grow quickly!