sql 分页查询 错误信息: com.alibaba.druid.sql.parser.ParserException: ERROR. token : FROM from

巴拉巴拉卟 发布于 2013/08/07 19:33
阅读 8K+
收藏 0

@wenshao 你好,想跟你请教个问题:

SELECT * from ( SELECT ID,MATTER,CODE,NAME,ADDRESS,AREA,PROPOSER,PROPOSER_CONTACTOR,PROPOSER_PHONE,REG_TIME,ASSIGN_TIME,DEPART,HANDLER,HANDLER_PHONE,STATUS,FINISH_DATE,FINISH_TYPE,DEPART_CODE,SYSTEM_CODE,rownum num FROM gxpt_items WHERE rownum<=20  order by REG_TIME desc )  WHERE num>0
com.alibaba.druid.sql.parser.ParserException: ERROR. token : FROM from
	at com.alibaba.druid.sql.parser.SQLExprParser.primary(SQLExprParser.java:457) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.primary(OracleExprParser.java:393) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.parser.SQLExprParser.bitXor(SQLExprParser.java:113) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.parser.SQLExprParser.multiplicativeRest(SQLExprParser.java:136) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.parser.SQLExprParser.exprRest(SQLExprParser.java:98) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.dialect.oracle.parser.OracleExprParser.exprRest(OracleExprParser.java:937) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.parser.SQLExprParser.expr(SQLExprParser.java:93) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList(OracleStatementParser.java:300) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList(OracleStatementParser.java:138) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:70) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.sql.visitor.ParameterizedOutputVisitorUtils.parameterize(ParameterizedOutputVisitorUtils.java:41) ~[druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.filter.stat.StatFilter.mergeSql(StatFilter.java:145) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.filter.stat.StatFilter.createSqlStat(StatFilter.java:627) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.filter.stat.StatFilter.statementPrepareAfter(StatFilter.java:305) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:124) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:446) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:342) [druid-0.2.11.jar:0.2.11]
	at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:312) [druid-0.2.11.jar:0.2.11]
	at org.apache.commons.dbutils.AbstractQueryRunner.prepareStatement(AbstractQueryRunner.java:154) [commons-dbutils-1.5.jar:1.5]
	at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:344) [commons-dbutils-1.5.jar:1.5]
	at org.apache.commons.dbutils.QueryRunner.query(QueryRunner.java:288) [commons-dbutils-1.5.jar:1.5]
	at com.gtjy.gxpt.bq.service.QueryBizService.findBuildData(QueryBizService.java:288) [QueryBizService.class:na]
	at com.gtjy.gxpt.bq.service.QueryBizService.createPaginationSQL(QueryBizService.java:680) [QueryBizService.class:na]
	at com.gtjy.gxpt.bq.service.QueryBizService$$FastClassByCGLIB$$3a297f46.invoke(<generated>) [cglib-nodep-2.2.jar:na]
	at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:191) [cglib-nodep-2.2.jar:na]
	at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:689) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110) [org.springframework.transaction-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at com.gtjy.commonapp.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:71) [AuthenticationInterceptor.class:na]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:161) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:90) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.aop.framework.Cglib2AopProxy$DynamicAdvisedInterceptor.intercept(Cglib2AopProxy.java:622) [org.springframework.aop-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at com.gtjy.gxpt.bq.service.QueryBizService$$EnhancerByCGLIB$$349639af.createPaginationSQL(<generated>) [cglib-nodep-2.2.jar:na]
	at com.gtjy.gxpt.bq.action.QueryBizAction.serchQry(QueryBizAction.java:439) [QueryBizAction.class:na]
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.6.0_26]
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) ~[na:1.6.0_26]
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) ~[na:1.6.0_26]
	at java.lang.reflect.Method.invoke(Method.java:597) ~[na:1.6.0_26]
	at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:176) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:263) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ConversionErrorInterceptor.intercept(ConversionErrorInterceptor.java:133) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ParametersInterceptor.doIntercept(ParametersInterceptor.java:207) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.StaticParametersInterceptor.intercept(StaticParametersInterceptor.java:190) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.MultiselectInterceptor.intercept(MultiselectInterceptor.java:75) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.CheckboxInterceptor.intercept(CheckboxInterceptor.java:94) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.FileUploadInterceptor.intercept(FileUploadInterceptor.java:243) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ModelDrivenInterceptor.intercept(ModelDrivenInterceptor.java:100) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ScopedModelDrivenInterceptor.intercept(ScopedModelDrivenInterceptor.java:141) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.debugging.DebuggingInterceptor.intercept(DebuggingInterceptor.java:267) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ChainingInterceptor.intercept(ChainingInterceptor.java:142) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.PrepareInterceptor.doIntercept(PrepareInterceptor.java:166) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:98) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.I18nInterceptor.intercept(I18nInterceptor.java:176) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.interceptor.ServletConfigInterceptor.intercept(ServletConfigInterceptor.java:164) [struts2-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.AliasInterceptor.intercept(AliasInterceptor.java:190) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.interceptor.ExceptionMappingInterceptor.intercept(ExceptionMappingInterceptor.java:187) [xwork-core-2.2.1.jar:2.2.1]
	at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:248) [xwork-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.impl.StrutsActionProxy.execute(StrutsActionProxy.java:52) [struts2-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.dispatcher.Dispatcher.serviceAction(Dispatcher.java:485) [struts2-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.dispatcher.ng.ExecuteOperations.executeAction(ExecuteOperations.java:77) [struts2-core-2.2.1.jar:2.2.1]
	at org.apache.struts2.dispatcher.ng.filter.StrutsPrepareAndExecuteFilter.doFilter(StrutsPrepareAndExecuteFilter.java:91) [struts2-core-2.2.1.jar:2.2.1]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
	at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:88) [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
	at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198) [org.springframework.orm-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76) [org.springframework.web-3.1.1.RELEASE.jar:3.1.1.RELEASE]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
	at com.gtjy.framework.servlet.CheckLoginFilter.doFilter(CheckLoginFilter.java:78) [CheckLoginFilter.class:na]
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235) [catalina.jar:na]
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206) [catalina.jar:na]
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230) [catalina.jar:na]
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) [catalina.jar:na]
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128) [catalina.jar:na]
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104) [catalina.jar:na]
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109) [catalina.jar:na]
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261) [catalina.jar:na]
	at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844) [tomcat-coyote.jar:na]
	at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:581) [tomcat-coyote.jar:na]
	at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447) [tomcat-coyote.jar:na]
	at java.lang.Thread.run(Thread.java:662) [na:1.6.0_26]

加载中
0
巴拉巴拉卟
巴拉巴拉卟
 SELECT xxxx FROM XXX 这样的sql没有问题. 是不是嵌套查询还需要转换一下?
0
王瑞平
王瑞平
需呀捋一捋
0
南湖船老大
南湖船老大
看起来是token解析的BUG,楼主这个版本好老,更新下试试吧
巴拉巴拉卟
巴拉巴拉卟
更新版本问题解决 谢谢
0
wenshao
wenshao
升级新版本吧druid-0.2.24
返回顶部
顶部