报错如下:
20:26:20,906 DEBUG JDBCExceptionReporter:63 - Could not execute JDBC batch update [insert into User (name, password, createTime, exipireTime, id) values (?, ?, ?, ?, ?)]
java.sql.BatchUpdateException: Incorrect string value: '\xE4\xB8\xAD\xE6\x96\x87' for column 'name' at row 1
hibernate.cfg.xml配置文件如下:
<property name="hibernate.connection.url">jdbc:mysql://localhost/hibernate_first?useUnicode=true&amp;characterEncoding=UTF-8&amp;</property>听说mysql5.0的配置文件不能添加:?useUnicode=true&amp;characterEncoding=UTF-8&amp;删掉后,可以插入,但存入的中文为乱码.这是怎么回事呢?