民航电子数据库:报错merge sql error, dbType null, druid-1.1.9, sql : xxx

news/2024/9/23 14:26:24/

目录

    • 一、场景
    • 二、SQL
    • 三、报错信息
    • 四、排查
    • 五、原因
    • 六、解决


一、场景

1、对接民航电子数据库

2、limit查询时报错


二、SQL

sql">SELECT openid,headimgurl,nickname FROM t_mb_weixinuser
WHERE openid=? AND vdnId = ?
LIMIT 1

三、报错信息

merge sql error, dbType null, druid-1.1.9, sql : SELECT openid,headimgurl,nickname FROM t_mb_weixinuserWHERE openid=? AND vdnId = ?LIMIT 1
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'     LIMIT 1', expect IDENTIFIER, actual IDENTIFIER pos 101, line 2, column 36, token IDENTIFIER LIMITat com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:284)at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:423)at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:72)at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:88)at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:50)at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:147)at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:648)at com.alibaba.druid.filter.stat.StatFilter.statementPrepareAfter(StatFilter.java:311)at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:158)at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:523)at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:384)at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:421)at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.createPreparedStatement(PreparedStatementExecutor.java:86)at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.access$100(PreparedStatementExecutor.java:45)at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor$1.createStatementExecuteUnit(PreparedStatementExecutor.java:78)at org.apache.shardingsphere.sharding.execute.sql.prepare.SQLExecutePrepareTemplate.getSQLExecuteGroup(SQLExecutePrepareTemplate.java:96)at org.apache.shardingsphere.sharding.execute.sql.prepare.SQLExecutePrepareTemplate.getSQLExecuteGroups(SQLExecutePrepareTemplate.java:87)at org.apache.shardingsphere.sharding.execute.sql.prepare.SQLExecutePrepareTemplate.getSynchronizedExecuteUnitGroups(SQLExecutePrepareTemplate.java:62)at org.apache.shardingsphere.sharding.execute.sql.prepare.SQLExecutePrepareTemplate.getExecuteUnitGroups(SQLExecutePrepareTemplate.java:54)at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.obtainExecuteGroups(PreparedStatementExecutor.java:69)at org.apache.shardingsphere.shardingjdbc.executor.PreparedStatementExecutor.init(PreparedStatementExecutor.java:64)at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.initPreparedStatementExecutor(ShardingPreparedStatement.java:211)at org.apache.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:144)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.apache.ibatis.logging.jdbc.PreparedStatementLogger.invoke(PreparedStatementLogger.java:59)at com.sun.proxy.$Proxy155.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 com.github.pagehelper.PageInterceptor.intercept(PageInterceptor.java:108)at org.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)at com.sun.proxy.$Proxy153.query(Unknown Source)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:148)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectList(DefaultSqlSession.java:141)at org.apache.ibatis.session.defaults.DefaultSqlSession.selectOne(DefaultSqlSession.java:77)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)at com.sun.proxy.$Proxy94.selectOne(Unknown Source)at org.mybatis.spring.SqlSessionTemplate.selectOne(SqlSessionTemplate.java:166)at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:82)at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)at com.sun.proxy.$Proxy99.findUserInfoByUserId(Unknown Source)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:343)at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:139)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)at com.sun.proxy.$Proxy100.findUserInfoByUserId(Unknown Source)at com.xxx.service.impl.SessionMsgServiceImpl.findUserInfoByUserId(SessionMsgServiceImpl.java:68)at com.xxx.service.impl.SessionMsgServiceImpl$$FastClassBySpringCGLIB$$b9b66a9.invoke(<generated>)at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:218)at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:749)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:88)at com.xxx.datasource.DataSourceAspect.around(DataSourceAspect.java:47)at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)at java.lang.reflect.Method.invoke(Method.java:498)at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethodWithGivenArgs(AbstractAspectJAdvice.java:644)at org.springframework.aop.aspectj.AbstractAspectJAdvice.invokeAdviceMethod(AbstractAspectJAdvice.java:633)at org.springframework.aop.aspectj.AspectJAroundAdvice.invoke(AspectJAroundAdvice.java:70)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:175)at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:93)at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:688)at com.xxx.service.impl.SessionMsgServiceImpl$$EnhancerBySpringCGLIB$$652fb78d.findUserInfoByUserId(<generated>)at com.xxx.util.MainHandlerUtil.insertSessionInfo(MainHandlerUtil.java:407)at com.xxx.util.MainHandlerUtil.proccessMain(MainHandlerUtil.java:112)at com.xxx.rocketmq.listener.ReceiveMessageConsumerServiceImpl.ASS_CCS_NewVisitorMsgEvt(ReceiveMessageConsumerServiceImpl.java:175)at com.xxx.rocketmq.listener.ReceiveMessageConsumerServiceImpl.consumerProcess(ReceiveMessageConsumerServiceImpl.java:106)at com.xxx.rocketmq.listener.base.RocketMQMessageService.consumeMessage(RocketMQMessageService.java:52)at org.apache.rocketmq.client.impl.consumer.ConsumeMessageConcurrentlyService$ConsumeRequest.run(ConsumeMessageConcurrentlyService.java:409)at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)at java.util.concurrent.FutureTask.run(FutureTask.java:266)at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)at java.lang.Thread.run(Thread.java:750)

四、排查

1、同样的代码,当对接mysql数据库时,查询是正常的

结论:对接民航电子数据库引起报错


五、原因

查看报错信息,应该是druid-1.1.9这个版本的依赖不兼容导致


六、解决

升级druid依赖的版本

这里是将druid-1.1.9升级为druid-1.1.22

<!-- druid数据源 -->
<dependency><groupId>com.alibaba</groupId><artifactId>druid</artifactId><version>1.1.22</version>
</dependency>

升级后即可正常分页查询

在这里插入图片描述


http://www.ppmy.cn/news/1442715.html

相关文章

iOS - Runloop在实际开发中的应用

文章目录 iOS - Runloop在实际开发中的应用1. 控制线程生命周期&#xff08;线程保活&#xff09;2. 解决NSTimer在滑动时停止工作的问题2.1. 案例2.2 解决 3. 监控应用卡顿4. 性能优化 iOS - Runloop在实际开发中的应用 1. 控制线程生命周期&#xff08;线程保活&#xff09;…

MySQL--创建,删除,查找,案例

1.数据库的---创建&#xff0c;删除&#xff0c;查找&#xff0c;案例 create database 数据库名称; # 创建一个数据库&#xff0c;所有参数默认 create database 数据库名称 [default chasetutf8mb4] # 创建的同时指定了编码2.drop删除 drop database 数据库名称;3.进入数据库…

ubuntu22.04安装TensorRT(过程记录)

重要说明&#xff1a;此贴经过多次修改。第一次安装的的为trt8.6.1版本。第二次安装的10.0.0.6版本。有些地方可能没改过来&#xff0c;比如链接向导&#xff0c;我懒得改了&#xff0c;但是流程是对的。 cuda和cudnn版本对应关系 tensorRT历史发行版本 CUDA历史发行版本 cudn…

MySql 查询优化

MySQL查询优化涉及多个方面&#xff0c;包括索引优化、查询优化、服务器配置优化等。以下是一些基本的查询优化技巧&#xff1a; 1.使用索引 确保你的查询利用了适当的索引。 SELECT * FROM table_name WHERE column_name value; 2.避免SELECT * 只选择需要的列&#xff…

STM32与OLED显示屏通信(四针脚和七阵脚)

系列文章目录 STM32单片机系列专栏 C语言术语和结构总结专栏 文章目录 1. 单片机调试 2. OLED简介 3. 接线 4. OLED驱动函数 4.1 四针脚版本 OLED.c OLED.h OLED_Font.h 4.2 七针脚版本 引脚连接 OLED.c OLED.h OLED_Font.h 5. 主函数 工程文件模板 1. 单片机…

回归预测 | Matlab实现ESN回声状态网络的多输入单输出回归预测

回归预测 | Matlab实现ESN回声状态网络的多输入单输出回归预测 目录 回归预测 | Matlab实现ESN回声状态网络的多输入单输出回归预测预测效果基本介绍程序设计参考资料 预测效果 基本介绍 1.Matlab实现ESN回声状态网络的多输入单输出回归预测&#xff08;完整源码和数据)&#x…

HarmonyOS —— 跳转应用详情页

一、跳转应用详情页 鸿蒙跳转应用详情页功能&#xff0c;使用场景可以是引导用户进入应用详情页授予应用权限。 gotoAppDetail(context:common.UIAbilityContext){let bundleName bundleManager.getBundleInfoForSelfSync(bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT)…

PINN物理信息网络 | 利用物理信息神经网络进行流体动力学建模

背景 物理信息神经网络(Physics-Informed Neural Networks,PINN)是一种结合了神经网络和物理方程的方法,用于建模和求解物理问题。传统的基于物理方程的数值方法在处理复杂的非线性偏微分方程时可能面临数值稳定性、高计算复杂度和网格依赖性等问题。而PINN作为一种数据驱…