String pages = paramsFormat.getString("page");//页数 int page = Integer.parseInt(pages);//页数 int pageSize = 10;//每页数量 int beginIndex = (page - 1) * pageSize; int endIndex = page * pageSize; SELECT * FROM (SELECT A.*, ROWNUM RN FROM (
//查询主SQL
....... ) A WHERE ROWNUM <= "+endIndex+") WHERE RN > "+beginIndex+"