FAQ(44): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy

关于基于Midas Civil API的二次开发——PyMiMi 现在写了第一条博客,希望是一个好的开始,能够每天抽出一两个小时或者更多的时间来写写代码,研究研究。我发现在我的工作中存在着大量的重复性工作,对于文档的开发是好办的,毕竟网上有现成库,只需要pip一下拿来用就好,但是对于Midas而言,在24版本之前官方都是没有一个可以使用的接口的,可能mct文件算半个? 阅读详情

2018/1/3

spring对Mybatis整合,

看Log:


org.springframework.jdbc.BadSqlGrammarException: 
### Error querying 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 'b.providerId='1',b.isPayment='2'
		        and b.providerId=p.id' at line 2
### The error may exist in com/smbms/dao/BillMapper.xml
### The error may involve com.smbms.dao.BillMapper.billShowByCondition-Inline
### The error occurred while setting parameters
### SQL: select b.billCode,b.productName,p.proName,b.totalPrice,b.isPayment,b.creationDate from smbms_bill b,smbms_provider p        where b.productName=?,b.providerId=?,b.isPayment=?           and b.providerId=p.id
### 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 'b.providerId='1',b.isPayment='2'
		        and b.providerId=p.id' at line 2
; 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 'b.providerId='1',b.isPayment='2'
		        and b.providerId=p.id' at line 2
	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:73)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:446)
	at com.sun.proxy.$Proxy8.selectList(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.selectList(SqlSessionTemplate.java:230)
	at org.apache.ibatis.binding.MapperMethod.executeForMany(MapperMethod.java:137)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:75)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:53)
	at com.sun.proxy.$Proxy11.billShowByCondition(Unknown Source)
	at com.smbms.service.BillServiceImpl.findBillsWithConditionsByThressConditions(BillServiceImpl.java:19)
	at com.smbms.service.BillServiceImplTest.test(BillServiceImplTest.java:30)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: 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 'b.providerId='1',b.isPayment='2'
		        and b.providerId=p.id' at line 2
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
	at java.lang.reflect.Constructor.newInstance(Unknown Source)
	at com.mysql.jdbc.Util.handleNewInstance(Util.java:425)
	at com.mysql.jdbc.Util.getInstance(Util.java:408)
	at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:943)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3973)
	at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3909)
	at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2527)
	at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2680)
	at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2487)
	at com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:1858)
	at com.mysql.jdbc.PreparedStatement.execute(PreparedStatement.java:1197)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
	at org.apache.commons.dbcp.DelegatingPreparedStatement.execute(DelegatingPreparedStatement.java:172)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)
	at com.sun.proxy.$Proxy13.execute(Unknown Source)
	at org.apache.ibatis.executor.statement.PreparedStatementHandler.query(PreparedStatementHandler.java:63)
	at org.apache.ibatis.executor.statement.RoutingStatementHandler.query(RoutingStatementHandler.java:79)
	at org.apache.ibatis.executor.SimpleExecutor.doQuery(SimpleExecutor.java:63)
	at org.apache.ibatis.executor.BaseExecutor.queryFromDatabase(BaseExecutor.java:324)
	at org.apache.ibatis.executor.BaseExecutor.query(BaseExecutor.java:156)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:109)
	at org.apache.ibatis.executor.CachingExecutor.query(CachingExecutor.java:83)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	... 31 more





解决:在使用Map传参给XML的sql语句时,Map的key没有跟sql中的变量名#{xxx}一致!

系统建模语言 (SysML) 系统建模语言 阅读详情

相关推荐

基于DFT的scanshift sdc模板(DFT)

摘要:本文详细介绍了DFT测试模式下的SDC约束方法。

murphyrong的博客 885

解决:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;

报错: Closing non transactional SqlSession [org.apache.ibatis.session.defaults.DefaultSqlSession@6feb46b8] 2021-04-26 10:25:06.643 ERROR 5924 --- [io-8080-exec-26] o.a.c.c.C.[.[.[.[dispatcherServlet] : Servlet.service() for servlet [dispatcherServlet] i

T 4741

电机控制个人学习路线及专业书籍资源分享

个人学习电机控制的学习路线,和相关专业书的电子文档分享

weixin_45182459的博客 9914

Java Web程序报错“jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax”的原因及解决方法

最近两天在编写Java Web程序的时候一直无法正确执行,日志里报的是“com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;”,踩了好多坑才解决了错误,所以想着汇总一下可能导致这个错误的几个原因,防止自己或别人再次踩坑。 1.这个错误的字面意思是SQL语句存在语法错误,所以发现报这个错第一件事应该是仔细看一下自己的SQL语句是否存在错误(大小写、空格等都不能错)。 2.

保温杯拖把风扇的博客 2416

Cortex-M TrustZone实战:从硬件隔离到安全交互的嵌入式开发指南

在嵌入式系统开发中,硬件安全隔离是构建可信执行环境(TEE)的核心技术。其原理是通过处理器硬件机制,将系统资源划分为安全与非安全域,实现内存、外设和代码的强制访问控制。这项技术的核心价值在于,它能在单一芯片上为资源受限的物联网(IoT)设备、智能传感器等提供芯片级的安全基础,无需依赖外置安全元件,从而降低BOM成本并简化设计。典型的应用场景包括保护设备密钥、实现安全启动、构建安全服务(如加密、密钥管理)以供应用程序调用。本文聚焦于Arm Cortex-M系列微控制器上的TrustZone技术实现,针对开发中

weixin_42639246的博客 300

大疆OcuSync系统背后的黑科技:跳频扩频技术如何让你的无人机飞得更稳

本文深入解析了大疆OcuSync系统如何运用跳频扩频技术等先进无线通信方案,显著提升无人机在复杂环境下的飞行稳定性。系统通过跳频扩频与直接序列扩频技术协同工作,结合双频智能切换与多天线MIMO,有效对抗信号干扰与多径效应,确保控制指令与高清图传的可靠、低延迟传输,为用户带来更安心、更流畅的飞行体验。

ol7890123的博客 628

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; che

问题描述: 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 ...

Light丶Long的博客 3万+

揭秘大厂 Unity 红点系统设计:别小看右上角那颗小红点,它能把你项目搞崩

本文详细探讨了游戏大厂如何设计高性能红点系统。红点作为提升用户活跃和转化率的重要工具,需要支持多级联动、动态判断和全局一致性。系统采用观察者模式和树形结构,分为数据管理、逻辑判定、订阅通知和UI展示四大模块,通过事件驱动方式实现高效刷新。文章特别强调了解耦设计、配置化管理和性能优化,并提出了热更新、数据分析等高级应用场景。最终指出,优秀的红点系统需要架构标准化、自动化配置和团队紧密协作,是大型游戏项目的关键技术基础。

本博客聚焦游戏开发技巧、创业实战心得及大学热门课程干货。这里既有技术深度,也有思维广度,无论你是开发者、创业者还是高校学子,都能在这里找到适合自己的成长之路! 377

Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL synt

碰到这样的问题说明 xml配置文件里面的sql语句出现了语法错误,要仔细检查是否多了标点符号,或者单词疏忽输入错误。

bijian0530的博客 670

Linux系统安装部署Redis完整教程(图文详解)

最近需要在Linux服务器安装部署Redis,参考了网上很多的文章,比较零碎,所以我自己写了一篇完整的Redis安装部署文档,在部署Redis之前重装了我的华为服务器,就是为了给大家一步步阐述我的操作过程,配合图文进行讲解更加通俗易懂!

黄团团的个人博客 6693

从 30 天试用到企业级落地,2026 年学习和试用 SAP AI 的完整路线图

摘要:SAP AI产品体系存在试用版本与商业版本的边界模糊问题,需区分业务嵌入AI(如Joule)、开发者工具(SAP Build Code)和AI基础平台(Generative AI Hub)三个层级。建议学习路径:1)通过SAP Learning专区掌握理论框架;2)优先使用30天Generative AI Hub基础试用体验模型编排;3)结合90天BTP试用账户开发完整应用。特别注意免费计划已陆续停止,需以最新官方文档为准。开发者应重点关注AI如何与SAP技术栈(CAP、Fiori等)集成,而非单纯功

2007 年 ~ 2025 年,深耕 SAP 技术 18 年 114

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax

在使用FOUND_ROWS() 进行一次查询出分页的列表和总条数的过程中,出现如下错误。 com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server ...

攻防人生3722的博客 1673

efm32 入门.pdf

本PDF共计22页,介绍的是操作驱动API,下载与否自己斟酌。

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException异常原因解析

今天,博主在写项目时遇到了com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException异常,这种异常变态到极致,一般都是自己的sql语句写错了。 @Insert({"insert into ",TABLE_NAME ," (",INSET_FIELDS, ") values (#{name},#{password}

Big Data 26万+

jre9下载 jdk9

(Java SE Runtime Environment 9.0) 9.0u175 官方最新版 【x86|x64】

计算机控制技术及应用

《计算机控制技术及应用》通过总结作者的科研成果和吸收国内外的先进理论、方法和技术,以计算机控制系统的网络化、开放化、智能化和集成化发展趋势为主线索,主要介绍计算机控制系统的基本概念和计算机控制系统的典型形式,计算机控制系统的数学描述与基本分析方法,以及数字PID控制器、最少拍控制系统、达林算法、状态变量设计法等设计方法及其各种改进算法。重点突出计算机控制系统输入输出通道接口的设计方法和典型控制系统的设计案例与实现方法等。

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;

zouxucong的博客 5641

Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL

使用sprig data jpa,hibernate由实体类自动生成表的时候提示有语法错误 Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQ...

victoyr的博客 7047

activiti中出现Error querying database.Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException

在activiti项目中出现错误: org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy

天行健,君子以自强不息 1万+

Spring JPA-Hibernate报错:com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an er解决方案

问题描述 今天在使用基于Hibernate的Spring Data JPA来保存一个实体类,当提交表单时,报如下Exception: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that correspond

zhoucheng05_13的博客 4万+

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException Table 'xinghe.base_class' doesn't exist

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException Table 'xinghe.base_class' doesn't existHTTP Status 500 - Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammar

无知人生,记录点滴 5万+

④sqlilabs的less-3和less-4

less-3和less-4都是基于字符型的SQL注入

熊俊坤的博客 880

com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax;

在xml中sql语句用PageHelper分页插件进行分页时报错: 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 ‘LIMIT 10’ at line 1 ;

qq_42990567的博客 7007

FAQ(43): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy

FAQ(43): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy

Diligence is the mother of success. 522
上一篇: FAQ(43): com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL sy
下一篇: (1)spring+springMVC+mybatis 简介
后台技术汇
博客等级 码龄11年 670粉丝 531原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

后台技术汇

对你的帮助,是对我的最好鼓励。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值