mysql添加中文数据失败
日志信息:
INFO 2015-01-13 10:44:36,078 org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [org/springframework/jdbc/support/sql-error-codes.xml]
INFO 2015-01-13 10:44:36,140 org.springframework.jdbc.support.SQLErrorCodesFactory: SQLErrorCodes loaded: [DB2, Derby, H2, HSQL, Informix, MS-SQL, MySQL, Oracle, PostgreSQL, Sybase]
控制台输出:
org.springframework.jdbc.UncategorizedSQLException:
### Error updating database. Cause: java.sql.SQLException: Incorrect string value: '\xE9\x83\xA8\xE9\x97\xA8...' for column 'deptname' at row 1
### The error may involve cn.jbit.mybatisdemo.dao.IDeptDao.insertDept-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO dept(deptname,location) VALUES(?,?)
### Cause: java.sql.SQLException: Incorrect string value: '\xE9\x83\xA8\xE9\x97\xA8...' for column 'deptname' at row 1
;
数据库/表/字段的编码格式不符合;