错误内容

org.springframework.jdbc.BadSqlGrammarException:
### Error updating database. Cause: java.sql.SQLSyntaxErrorException: 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 '= '553fe0583195819abb6bf1bd2f03d5f32a17f2238f9d23d6c70f67e947e43b33',
' at line 2
### The error may involve com.slabs.upload.database.mapper.AgentBillDetailDAO.batchUpdateSealIdByPrimaryKey-Inline
### The error occurred while setting parameters
### SQL: update agent_bill_detail seal_id = ?, is_send = ?, receive_time = ? where detail_id = ? ; update agent_bill_detail seal_id = ?, is_send = ?, receive_time = ? where detail_id = ?
### Cause: java.sql.SQLSyntaxErrorException: 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 '= '553fe0583195819abb6bf1bd2f03d5f32a17f2238f9d23d6c70f67e947e43b33',
' at line 2
; bad SQL grammar []; nested exception is java.sql.SQLSyntaxErrorException: 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 '= '553fe0583195819abb6bf1bd2f03d5f32a17f2238f9d23d6c70f67e947e43b33',
' at line 2

解决方法

本人连接的是mysql数据库,检查sql语法并无错误。而此处为 多条query语句,报错信息指向分号后的第二条语句。
判断可能是连接的datasource默认只允许执行单个query语句。
在连接datasource的url后面增加参数allowMultiQueries=true

url: jdbc:mysql://localhost:3306/node_seal?serverTimezone=UTC&zeroDateTimeBehavior=round&allowMultiQueries=true

[mybatis] sql语句无错误,但是执行多条sql语句时,抛出java.sql.SQLSyntaxErrorException的更多相关文章

  1. JDBC获取连接抛出java.sql.SQLException: The server time zone...

    今天尝试数据库,代码确实没问题就是给了给这个东西 java.sql.SQLException: The server time zone value '�й���׼ʱ��' is unrecogniz ...

  2. sql执行万条update语句优化

    几个月没有更新笔记了,最近遇到一个坑爹的问题,顺道记录一下.. 需求是这样的:一次性修改上万条数据库. 项目是用MVC+linq的. 本来想着用 直接where() 1 var latentCusto ...

  3. {MySQL的逻辑查询语句的执行顺序}一 SELECT语句关键字的定义顺序 二 SELECT语句关键字的执行顺序 三 准备表和数据 四 准备SQL逻辑查询测试语句 五 执行顺序分析

    MySQL的逻辑查询语句的执行顺序 阅读目录 一 SELECT语句关键字的定义顺序 二 SELECT语句关键字的执行顺序 三 准备表和数据 四 准备SQL逻辑查询测试语句 五 执行顺序分析 一 SEL ...

  4. MySQL实战 | 01-当执行一条 select 语句时,MySQL 到底做了啥?

    原文链接:当执行一条 select 语句时,MySQL 到底做了啥? 也许,你也跟我一样,在遇到数据库问题时,总时茫然失措,想重启解决问题,又怕导致数据丢失,更怕重启失败,影响业务. 就算重启成功了, ...

  5. pybot执行多条用例时,某一个用例执行失败,停止所有用例的执行

    问题: pybot执行多条用例时,某一个用例执行失败,停止所有用例的执行 解决办法: pybot -exitonfailure E:\robot\呼送项目\测试用例\基本流程\主流程.txt 参考文章 ...

  6. java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Date

    架构使用jsp+servlet+java+mysql mysql里time字段类型为datetime java实体类中该字段类型为Date 页面中,时间字段类型为空的信息显示不出来,且报错信息如下: ...

  7. java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

    下面是我查询数据库时打印出来的异常信息: ### Error querying database.  Cause: java.sql.SQLException: Value '0000-00-00 0 ...

  8. Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

    错误信息如下: Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java ...

  9. 报错 java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 原因

    sql异常 java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestam ...

随机推荐

  1. 怎么才能从github上面快速clone代码

    搜了很多教程,包括该本地host配置.在git上输入命令.使用githubdesktop等等方法,最后都不行,这位朋友讲的,先把仓库clone到码云上面,再从码云上面拉代码,速度会非常快. 传送门 g ...

  2. ASM与ASMD

    时序机 状态机 控制器 数据通路之间的关系 样例代码

  3. css3中calc、vw、vh、vmin、vmax 属性的应用及兼容性详解

    一. calc()的使用什么是calc()? calc()从字面我们可以把他理解为一个函数function.其实calc是英文单词calculate(计算)的缩写,是css3的一个新增的功能,用来指定 ...

  4. 【LOJ6397】「THUPC2018」蛋糕 / Cake(搜索)

    点此看题面 大致题意: 把一个\(a\times b\times c\times d\)的\(4\)维图形划分成\(a\times b\times c\times d\)个小块,求有\(0\sim8\ ...

  5. 关于group by的用法 原理

    转载: https://blog.csdn.net/u014717572/article/details/80687042. 写在前面的话:用了好久group by,今天早上一觉醒来,突然感觉grou ...

  6. 使用composer安装Larave提示“Changed current directory to C:/Users/Administrator/AppData/Roaming/Composer”

    解决办法: 根据官方手册执行composer global require "laravel/installer" 显示Changed current directory to C ...

  7. Codeforces Round #599 (Div. 1) C. Sum Balance 图论 dp

    C. Sum Balance Ujan has a lot of numbers in his boxes. He likes order and balance, so he decided to ...

  8. Codeforces Round #598 (Div. 3) D. Binary String Minimizing 贪心

    D. Binary String Minimizing You are given a binary string of length n (i. e. a string consisting of ...

  9. HTML连载43-还原字体和字号、文字界面

    一.还原字体和字号 1.利用fireworks切片以及文本添加的功能可以用来定位我们想要的文字是什么字体,行高又是多少,但其实很low,是我们人工挑选出来的. 2.注意点:在企业开发中,如果一个盒子中 ...

  10. 关于 ASP.NET Core 中的 RazorPages

    Contact.cshtml @page @model ContactModel @{ ViewData["Title"] = "Contact"; } < ...