报错如下:
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&characterEncoding=UTF-8&</property>听说mysql5.0的配置文件不能添加:?useUnicode=true&characterEncoding=UTF-8&删掉后,可以插入,但存入的中文为乱码.这是怎么回事呢?
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&characterEncoding=UTF-8&</property>听说mysql5.0的配置文件不能添加:?useUnicode=true&characterEncoding=UTF-8&删掉后,可以插入,但存入的中文为乱码.这是怎么回事呢?
解决方案 »
- 学习java web的困惑
- xml数据,用xlt语言。。怎么显示系统时间。。
- 有关网络爬虫速度
- 用正则表达式拆分字符串长度问题
- 请教:网线拔了hibernate报错是怎么回事(谢谢)
- 大家快来帮帮忙啊!hibernate问题
- 每次登录首页cookie中信息不全
- 类实现ApplicationContextAware接口,没有调用setApplicationContext方法
- request.setAttribute()可以传递对象吗??--这个有人知道吗?
- 关于服务器托管的简单问题
- Servlet问题 ServletRequest的setCharacterEncoding()用在servlet中有什么用途?
- JSTL怎么从request里接收一个javabean对象
然后重启mysql服务就可以了
我还是自己回复一下吧,供以后出现同类问题的人们查看.呵呵