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
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