xxb2sq 2015-09-18 02:38 采纳率: 0%
浏览 4876
已采纳

sql报错,求大神帮忙看看,在线等!

Caused by: java.sql.SQLException: sql injection violation, syntax error: TODO : LITERAL_INT top : select top 20 * from (select row_number() over ( order by name asc ) row_number, * from (select id,name,display_Name,type,instance_Url,state, content, version,create_Time,creator from wf_process where 1=1 and state = ? ) aa ) a where row_number > 0 order by row_number
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:711)
at com.alibaba.druid.wall.WallFilter.connection_prepareStatement(WallFilter.java:240)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:448)
at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:928)
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:122)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:448)
at com.alibaba.druid.filter.FilterAdapter.connection_prepareStatement(FilterAdapter.java:928)
at com.alibaba.druid.filter.FilterEventAdapter.connection_prepareStatement(FilterEventAdapter.java:122)
at com.alibaba.druid.filter.FilterChainImpl.connection_prepareStatement(FilterChainImpl.java:448)
at com.alibaba.druid.proxy.jdbc.ConnectionProxyImpl.prepareStatement(ConnectionProxyImpl.java:342)
at com.alibaba.druid.pool.DruidPooledConnection.prepareStatement(DruidPooledConnection.java:318)
at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1436)
at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:581)
... 126 more
Caused by: com.alibaba.druid.sql.parser.ParserException: TODO : LITERAL_INT top
at com.alibaba.druid.sql.dialect.oracle.parser.OracleStatementParser.parseStatementList(OracleStatementParser.java:490)
at com.alibaba.druid.sql.parser.SQLStatementParser.parseStatementList(SQLStatementParser.java:112)
at com.alibaba.druid.wall.WallProvider.checkInternal(WallProvider.java:619)
at com.alibaba.druid.wall.WallProvider.check(WallProvider.java:574)
at com.alibaba.druid.wall.WallFilter.check(WallFilter.java:699)
... 138 more

  • 写回答

2条回答 默认 最新

  • Tiger_Zhao 2015-09-18 02:54
    关注

    ORACLE 没有 SELECT TOP 语句,要用行号作为条件进行过滤

        select *
          from (select row_number() over ( order by name asc ) row_number,
                       *
                  from (select id,name,display_Name,type,instance_Url,state, content, version,create_Time,creator
                          from wf_process
                         where 1=1
                          and state = ?
                       ) aa
               ) a
         where row_number BETWEEN 1 AND 20
      order by row_number
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥20 mpich安装完成后出问题
  • ¥15 multisim仿真
  • ¥15 stm32循迹小车代码问题
  • ¥15 输入一堆单词,使其去重输出
  • ¥15 qc代码,修改和添加东西
  • ¥50 Unity的粒子系统使用shadergraph(内置管线)制作的一个顶点偏移shader,但是粒子模型移动时,顶点也会偏移
  • ¥15 如何用python处理excel的数据(极值标准化)
  • ¥15 三向应力状态求剪应力
  • ¥15 jupyter notebook如何添加libGL.so.1库
  • ¥20 easyPoi能否实现下拉多选或者复选框