mybatis-plus3 You have an error in your SQL syntax; check the manual that corresponds to your MySQL

17 篇文章 1 订阅
4 篇文章 0 订阅

一,错误描述

    使用mybatis-plus3  新增,调用save方法新增报错。怎么看都没有问题,按理说不会出现问题,sql打印出来感觉语法也没问题,一时就懵逼了。最后还是使用老办法,把对应的数据库SQL放到数据库中执行查看,果然。。。。。

 

 INSERT INTO operationlog  ( operationuser,  interfacename, describe, reqparam, respparam,  opermodul, opertype )  VALUES  ( ?,  ?, ?, ?, ?,  ?, ? )

使用了关键字  describe,记录下吧  。知道哪出现问题了,直接把字段换一下,解决

describe   -- operdescribe

此类问题一般是数据库语法错误,不要相信自己的感觉,建议朋友们把SQL放在数据库中试一下

 

二,控制台报错

org.springframework.jdbc.BadSqlGrammarException: 
### Error updating database.  Cause: java.sql.SQLSyntaxErrorException: 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 'describe,
reqparam,
respparam,

opermodul,
opertype )  VALUES  ( '1',

'com.sgfd' at line 4
### The error may exist in com/sgfd/mapper/OperationlogMapper.java (best guess)
### The error may involve com.sgfd.mapper.OperationlogMapper.insert-Inline
### The error occurred while setting parameters
### SQL: INSERT INTO operationlog  ( operationuser,  interfacename, describe, reqparam, respparam,  opermodul, opertype )  VALUES  ( ?,  ?, ?, ?, ?,  ?, ? )
### Cause: java.sql.SQLSyntaxErrorException: 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 'describe,
reqparam,
respparam,

opermodul,
opertype )  VALUES  ( '1',

'com.sgfd' at line 4
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 'describe,
reqparam,
respparam,

opermodul,
opertype )  VALUES  ( '1',

'com.sgfd' at line 4
	at 。。。。。。

 

评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值