HTTP Status 500-hibernate operation:could not insert: [cn.itcast.shop.product.vo.Product]; Uncategorized sqlexcept Ion for SQL [insert INTO Product (PName, Market_price, Shop_price, image, Pdesc, Is_hot, pdate, CSID) VALUES (?,?,?,?, ?, ?, ?, ?)]; SQL state [HY000]; Error code [1366]; Incorrect string value: ' \xe7\x99\xbb\xe9\x99\x86 ... ' for column ' image ' at row 1; Nested exception is Java.sql.SQLException:Incorrect string value: ' \xe7\x99\xbb\xe9\x99\x86 ... ' for column ' image ' at row 1
Problem with Image field type
To modify a field type:
Mysql> ALTER TABLE product modify image varchar (255) CharSet UTF8 collate utf8_general_ci;
Query OK, rows affected
enregistrements:71 doublons:0 avertissements:0
Extended:
Modify Field Name:
Mysql> ALTER TABLE product change image images varchar (255);
Query OK, 0 rows affected
enregistrements:0 doublons:0 avertissements:0
Nested exception is Java.sql.SQLException:Incorrect string value: ' \xe7\x99\xbb\xe9\x99\x86 ... ' for column ' image ' at row 1