druid ParserException: syntax error

oyxsuwqo  于 2022-10-21  发布在  Druid
关注(0)|答案(1)|浏览(372)

数据库驱动用的是Derby Client Driver10.12.1.1,Druid版本1.0.16
log如下:
[02-Jan-2016 09:41:35] [ERROR] com.alibaba.druid.filter.stat.StatFilter merge sql error, dbType derby, sql :
VALUES 1
com.alibaba.druid.sql.parser.ParserException: syntax error, error in :'VALUES 1',expect VALUES, actual VALUES VALUES
at com.alibaba.druid.sql.parser.SQLParser.printError(SQLParser.java:231) ~[druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:407) ~[druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:145) ~[druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:140) ~[druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:53) ~[druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:145) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:630) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.stat.StatFilter.internalBeforeStatementExecute(StatFilter.java:397) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.stat.StatFilter.statementExecuteQueryBefore(StatFilter.java:335) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.FilterEventAdapter.statement_executeQuery(FilterEventAdapter.java:299) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.filter.FilterChainImpl.statement_executeQuery(FilterChainImpl.java:2360) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.proxy.jdbc.StatementProxyImpl.executeQuery(StatementProxyImpl.java:211) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.pool.DruidAbstractDataSource.validateConnection(DruidAbstractDataSource.java:1240) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.pool.DruidAbstractDataSource.createPhysicalConnection(DruidAbstractDataSource.java:1450) [druid-1.0.16.jar:1.0.16]
at com.alibaba.druid.pool.DruidDataSource.init(DruidDataSource.java:632) [druid-1.0.16.jar:1.0.16]
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:1.7.0_80]
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[?:1.7.0_80]
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.7.0_80]
at java.lang.reflect.Method.invoke(Method.java:606) ~[?:1.7.0_80]
......

‘VALUES 1’是验证连接有效的query,它在Derby中能够执行,所以虽然报错,但是这条SQL被正确执行

vlju58qv

vlju58qv1#

将mergeSQL设置为false后,无异常抛出

相关问题