问答详情
源自:4-3 商品模型模型--商品创建03

我在创建商品添加到数据库时,使用insertSelective()方法,也设置主键自增了,为何会报下面的错误,xml文件是代码生成器生成的,useGeneratedKeys和keyProperty我也写了


### The error may involve com.miaosha.dao.ItemMapper.insertSelective-Inline### The error occurred while setting parameters### SQL: >          insert into item      ( title,                       price,                       description,                              img_url )       values ( ?,                       ?,                       ?,                              ? )

### Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '> 

 insert into item     ( title,                    price,        ' at line 1; 

bad SQL grammar []; nested exception is com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '>

 insert into item     ( title,                    price,        ' at line 1]



提问者:慕村6028198 2019-09-24 12:52

个回答

  • 夜子ltx
    2020-05-23 00:52:49

    请问这个问题最终怎么解决的?