zoukankan      html  css  js  c++  java
  • 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集合为空,请检查代码!

  • 相关阅读:
    ab参数详解 – 压力测试
    configure/make/make install的作用
    LNMP第二部分nginx、php配置
    centos 6.9安装mysql
    HDFS Java API的使用举例
    配置SSH无秘钥登录
    一篇文章学懂Shell脚本
    自己实现一个简单的网购秒杀系统
    hadoop伪分布式环境搭建
    vmware虚拟机的克隆
  • 原文地址:https://www.cnblogs.com/guangfu007/p/11649865.html
Copyright © 2011-2022 走看看