用mybatis连接数据库的时候出现这个报错
org.apache.ibatis.exceptions.PersistenceException:###Errorupdatingdatabase.Cause:com....
org.apache.ibatis.exceptions.PersistenceException:
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
'阿莫西林颗粒',
' at line 10
### The error may involve classes.GoodsMapper.addGoods-Inline
### The error occurred while setting parameters
我的代码是
INSERT INTO GOODS(
goodName,
price,
specification,
quantity,
manufacturer,
classTwoID,
trademark,
instruction,
usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
#{goodName},
#{price},
#{specification},
#{quantity},
#{manufacturer},
#{classTwoID},
#{trademark},
#{instruction},
#{usage},
#{approvalNum},
#{goodClass},
#{goodfunction}
) 展开
### Error updating database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
'阿莫西林颗粒',
' at line 10
### The error may involve classes.GoodsMapper.addGoods-Inline
### The error occurred while setting parameters
我的代码是
INSERT INTO GOODS(
goodName,
price,
specification,
quantity,
manufacturer,
classTwoID,
trademark,
instruction,
usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
#{goodName},
#{price},
#{specification},
#{quantity},
#{manufacturer},
#{classTwoID},
#{trademark},
#{instruction},
#{usage},
#{approvalNum},
#{goodClass},
#{goodfunction}
) 展开
3个回答
展开全部
看是不是#{usage}后面忘记打逗号了。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
SQL写的有问题 亲。。。写得很明白了。。You have an error in your SQL syntax;
for the right syntax to use near 'usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
'阿莫西林颗粒',
' at line 10
for the right syntax to use near 'usage,
approvalNum,
goodClass,
goodfunction
)VALUES(
'阿莫西林颗粒',
' at line 10
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
values应该改为value吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询