[mybatis] sql语句无错误,但是执行多条sql语句时,抛出java.sql.SQLSyntaxErrorException...
错误内容
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...相关推荐
- [mybatis] sql语句无错误,但是执行多条sql语句时,抛出java.sql.SQLSyntaxErrorException
错误内容 org.springframework.jdbc.BadSqlGrammarException: ### Error updating database. Cause: java.sql.S ...
- MySQL实战 | 01 当执行一条 select 语句时,MySQL 到底做了啥?
原文链接:当执行一条 select 语句时,MySQL 到底做了啥? 也许,你也跟我一样,在遇到数据库问题时,总时茫然失措,想重启解决问题,又怕导致数据丢失,更怕重启失败,影响业务. 就算重启成功了, ...
- mysql执行两条update语句
执行两条update语句,没有join关联时 update dp_auto_group_price dagp ,dp_auto_group dag set dagp.is_pub = 0 ,dag.s ...
- java.sql.SQLException: Value ”0000-00-00 00:00:00“ can not be represented as java.sql.Timestamp
java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp 分析: ...
- 已解决:java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Timestamp
一.问题 一大早到公司 Mysql 中的一个 datetime 字段时碰到了一个 Cause: java.sql.SQLException: Value '0000-00-00 00:00:00' c ...
- Caused by: java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.Tim
一.今天在使用Seatunnel从Mysql往Hive抽数时,报错: Caused by: java.sql.SQLException: Value '0000-00-00 00:00:00' can ...
- mysql查表的时候报错:java.sql.SQLException: Value ‘0000-00-00 00:00:00‘ can not be represented as java.sql.T
mysql查表的时候报错:java.sql.SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.T ...
- python执行oracle的sql语句_在oracledb中执行SQL脚本一次执行一条语句
假设我有一个sql脚本,如下所示:--split statement 1 ALTER TABLE abs ADD (make VARCHAR2(2 byte), model varCHAR2(12 B ...
- oracle常用插入一条语句,Oracle:用一条 INSERT 语句批量插入多条记录
用一条 INSERT 语句批量插入多条记录,实例如下: 先建立这样一个表 T: SQL> DESC T Name Null? Type ---- ...
最新文章
- 户外私密Party | 在大峡谷里聊一点平时不能聊的干货(报名ing...)
- python split()方法_秘籍:10个Python字符串处理技巧(附代码)
- python微信跳一跳小游戏刷分
- 用训练好的paddlepaddle模型继续训练模型和验证数据ckpt
- tcp_v4_connect函数分析
- 12个必备的JavaScript装逼技巧
- python cx_oracle配置_用Python设置cx_Oracle环境变量
- mock gps android,GitHub - Hilaver/MockGPS: Android application to fake GPS
- 【软考软件评测师】2011年下案例分析历年真题
- 迅捷路由器重新设置后服务器无响应,迅捷路由器恢复出厂设置后怎么重新设置...
- 分享一个在线转码工具网站 文档音视频压缩等
- 贝叶斯算法 — 朴素贝叶斯分类器— 过滤垃圾邮件 — 流失用户 — 用户画像
- 百度地图设置显示中心点
- android go 小米1,小米首款Android Go入门机红米Redmi Go发布,1GB+8GB运存
- 多源异构航班航迹数据流实时融合方法研究
- Oracle中to_char函数和MySQL中的str_to_date函数区别
- 区块链知识系列 - 区块链大事记
- 电路交换,报文交换,分组交换简介与优缺点
- 试试在transformers中调用ERNIE
- Ogre个人初步学习总结