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集合为空,请检查代码!

  • 相关阅读:
    linux下查找文件中空行的行号
    JavaScript:jklyDB
    Chart:Amcharts
    Chart-template
    Miscellaneos:ISV
    杂项-模板
    Error-MVCr:找到了多个与 URL 匹配的控制器类型。如果多个控制器上的特性路由与请求的 URL 匹配,则可能会发生这种情况。
    Error-MVC:HTTP Error 500.19
    ASP.NET 网站管理工具
    HTML:Browser 对象
  • 原文地址:https://www.cnblogs.com/guangfu007/p/11649865.html
Copyright © 2011-2022 走看看