JSP is as follows: ********************* <% @ page language = "java" import = "java.util. *, Java.sql. *"% > <% @ Page ContentType = "Text / HTML; Charset = GB2312"%> <% int curpage = 1; // Current page INT Page_Record = 20; // The number of records displayed per page // Use the following method (SQL query is completed, fast) CURPAGE = Integer.Parseint (Request.GetParameter ("page")))); // Get the delivered value, page ResultSet RS = cn.rsexecuteQuery ("SELECT TOP" Page_Record "* from Tablename Where ID NOT IN (SELECT TOP) " (CURPAGE * PAGE_RECORD) " ID from Tablename Order By ID "); // This query statement is obtained by 20 records of the 1000 pages you want to display, and the rough ideas are - subquery exclude All records before the records need to be displayed, the parent query is descended in descending of the remaining records for the remaining records (rs.next) {Out.println (rs.getint ("ID"). TOSTRING ());}}}}}}}}}}}}}}}}}}}}}}} Rs.close () ;%>