Here you can find the source of moveToPageNo(ResultSet rs, int pageNo, int pageSize)
Parameter | Description |
---|---|
rs | The result set cursor move to page number. |
pageNo | The current page number. |
pageSize | The page size of one page. |
Parameter | Description |
---|---|
SQLException | an exception |
public static void moveToPageNo(ResultSet rs, int pageNo, int pageSize) throws SQLException
//package com.java2s; //License from project: Apache License import java.sql.ResultSet; import java.sql.SQLException; public class Main { /**/* w w w . j a va2s. co m*/ * The result set cursor move to current page number. * * @param rs The result set cursor move to page number. * @param pageNo The current page number. * @param pageSize The page size of one page. * @throws SQLException */ public static void moveToPageNo(ResultSet rs, int pageNo, int pageSize) throws SQLException { if (pageNo > 1) { int row = (pageNo - 1) * pageSize; rs.absolute(row); } } }