2 dongfandong dongfandong 于 2015.06.11 13:41 提问

本地测试没问题,部署到网站上就出现这样的问题
ssh

HTTP Status 500 - Hibernate operation: could not insert: [dd.po.User]; uncategorized SQLException for SQL [insert into user (NICKNAME, USERID, PASSWORD, HEAD_PIC, SEX, BIRTHDAY, PROVINCE, CITY, COUNTY, FANS, FOCUS) values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]; SQL state [HY000]; error code [1366]; Incorrect string value: '\xB3\xA4\xB4\xF3\xC8\xCB' for column 'NICKNAME' at row 1; nested exception is java.sql.SQLException: Incorrect string value: '\xB3\xA4\xB4\xF3\xC8\xCB' for column 'NICKNAME' at row 1

3个回答

mlw519
mlw519   2015.06.11 14:37

数据库编码格式的问题,插入的String是UTF-8编码

dongfandong
dongfandong   2015.06.11 14:44

数据库的编码格式是utf-8啊

frank_20080215
frank_20080215   2015.06.11 22:31

编码格式不同造成的,选择一处修正编码

Csdn user default icon
上传中...
上传图片
插入图片