private static int extractLimit ( String queryString ) { int limitIndex = queryString . lastIndexOf ( "limit" ) ; if ( limitIndex == - 1 ) { limitIndex = queryString . lastIndexOf ( "LIMIT" ) ; } if ( limitIndex == - 1 ) { return limitIndex ; } String limitValue = queryString . substring ( limitIndex + 5 ) ; return Integer . parseInt ( limitValue . trim ( ) ) ; }
Extracts limit value from query string .