设为首页 加入收藏

TOP

mybatis批量新增报错 BadSqlGrammarException
2019-10-11 11:20:19 】 浏览:124
Tags: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集合为空,请检查代码!

 

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Zabbix 4.0 监控MySQL 5.7 下一篇Redhat6.5安装oracle11g

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目