mybatis批量新增报错 BadSqlGrammarException

摘要:
org.springframework.jdbc.BadSqlGrammarException:work_ place,user_ code,create_ date,nestedexceptioniscom.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException:

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》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇lua中table的遍历,以及删除jQuery .tmpl(), .template()学习资料小结下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

SpringBoot 数据篇之使用JDBC

SpringBootTutorial :: Data :: Jdbc 简介 API execute update query 实战 配置数据源 完整示例 引申和引用 简介 Spring Data 包含对 JDBC 的存储库支持,并将自动为 CrudRepository 上的方法生成 SQL。对于更高级的查询,提供了 @Query 注解。 当...

SpringBoot入门篇

一    什么是springboot Spring官网:http://spring.io/projects SpringBoot是Spring项目中的一个子工程,与我们所熟知的Spring-framework 同属于spring的产品: Springboot不是什么真正意义上的新框架,就像maven整合了所有的jar包,spring boot整合了所有常...

php时间戳和日期转换,以及时间戳和星期转换

$this->created_at为时间戳值,转换日期如下 date('m.d',$this->created_at) :  y 代表年的后两位如 17 ,Y 代表 2017  , m 代表数字月,M 代表英文月 ,d代表日,D代表星期 (英文的) 想要显示中文星期,则要:  $weeks =['周一','周二','周三','周四','周五',...

dateutil

Date、long、Calendar之间的相互转换 //当前时间 Date date = DateUtil.date(); //当前时间 Date date2 = DateUtil.date(Calendar.getInstance()); //当前时间 Date date3 = DateUtil.date(System.currentTimeMillis...

Apache Solr配置

Solr配置 Solr的主要功能是全文检索,该功能分为两个过程:创建索引和对索引进行搜索; 在创建索引之前,需要重点关注两个配置文件:SOLR_HOME/collection1/conf/schema.xml(定义Document的结构类似定义DB的表结构) & solrconfig.xml(solr运行配置如请求如何被处理);在Solr创建索引...

vue 时间戳转换

vue 时间戳转换 //显示小时和分钟 {{ new Date( +new Date(new Date(itemC.StartTime).toJSON()) + 8 * 3600 * 1000 ) .toISOString() .replace(/T/g, " ") .replace(/.[d]{3}Z/...