首页 > 代码库 > nested exception is java.sql.SQLException: 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
HTTP Status 500 - Hibernate operation: could not insert: [cn.itcast.shop.product.vo.Product]; uncategorized SQLException 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
image字段类型有问题
修改字段类型:
mysql> alter table product modify image varchar(255) charset utf8 collate utf8_general_ci;
Query OK, 71 rows affected
Enregistrements: 71 Doublons: 0 Avertissements: 0
扩展:
修改字段名称:
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
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。