mybatis批量新增报错 BadSqlGrammarException
org.springframework.jdbc.badsqlgrammarexception:
### 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 '' at line 7
### the error may involve com.yks.eco.dao.ecostaffdao.insertbatch-inline
### the error occurred while setting parameters
### sql: insert into ykseco.eco_staff (name,userid, order_in_depts, unionid, position, mobile, tel, work_place, remark, email, org_email, jobnumber, is_hide, is_admin, is_boss, is_leader, active, hired_date, avatar, extattr, user_code, creater, create_date, modifier ) values
### 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 '' at line 7
; 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 mysql server version for the right syntax to use near '' at line 7
at org.springframework.jdbc.support.sqlerrorcodesqlexceptiontranslator.dotranslate(sqlerrorcodesqlexceptiontranslator.java:231)
at org.springframework.jdbc.support.abstractfallbacksqlexceptiontranslator.translate(abstractfallbacksqlexceptiontranslator.java:73)
at org.mybatis.spring.mybatisexceptiontranslator.translateexceptionifpossible(mybatisexceptiontranslator.java:74)
at org.mybatis.spring.sqlsessiontemplate$sqlsessioninterceptor.invoke(sqlsessiontemplate.java:399)
at com.sun.proxy.$proxy22.insert(unknown source)
注意:sql语句在values之后就没有了,这是由于传入的list集合为空,请检查代码!
上一篇: 怎么吹口哨?口哨吹响有技巧
推荐阅读
-
mybatis批量新增报错 BadSqlGrammarException
-
Mybatis generator生成Service,Controller,添加批量新增数据接口(基于mybatis-generator-1.3.5源码修改)
-
mybatis的批量修改 之 ——」执行多条sql报错
-
解决mybatis批量更新出现SQL报错问题
-
解决mybatis批量更新出现SQL报错问题
-
mybatis批量修改,批量新增
-
MyBatis MapperProvider MessageFormat拼接批量SQL语句执行报错的原因分析及解决办法
-
Mybatis批量修改时出现报错问题解决方案
-
Gbase 8s 批量新增 mybatis
-
mybatis批量新增报错 BadSqlGrammarException