{
boolean isSuccess=false;
sqlStr1="insert into studetailinfo(SerialNumber,StuName,sex,nationality,profession,standardOfCulture,YYYY,MM,DD,IDcard,departmentClasses,level,choice,makeUpSub,admissionCardNum,train,conNum)values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)";
String[] params1={sdi.getSerialNum(),sdi.getStuName(),sdi.getSex(),sdi.getNationality(),sdi.getProfession(),sdi.getStandardOfCulture(),sdi.getYYYY(),sdi.getMM(),sdi.getDD(),sdi.getIDcard(),sdi.getDepartmentClasses(),sdi.getLevel(),sdi.getChoice(),sdi.getMakeUpSubject(),sdi.getAdmissionCardNum(),sdi.getTrain(),sdi.getConNum()};
try {
super.executeUpdateSQL(sqlStr1,params1);
isSuccess=true;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
return isSuccess;
}
插入数据库时报这个错:
在html里StuName文本框里输入中文就会报这个错,my.ini的配置文件改过了,建数据库时用的是UTF-8编码
Incorrect string value: '\xE5\x91\xA8\xE9\x91\xAB' for column 'StuName' at row 1
2 个解决方案
#1
up
#2
up
#1
up
#2
up