public class JDBCPager extends Object implements DBPager
Constructor and Description |
---|
JDBCPager(JDBCConnection connection,
QueryInfo queryInfo,
ResultSet resultSet,
int rowsPerPage) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes the pager and its underlying resources.
|
Result |
firstPage()
Scrolls to the first Page
|
int |
getCurrentPageIndex()
returns the number of the current Page
|
DBDataSource<?> |
getDataSource() |
int |
getMaxPageIndex()
returns the number of the last Page
|
int |
getRowsPerPage()
Returns the number of rows to be shown on a page.
|
int |
getTotalRows()
Returns the number of all rows, returned from the database
|
Result |
gotoPage(int page)
Scrolls to the given pageNumber
|
Result |
gotoRow(int row)
Scrolls to the given row
|
boolean |
hasNextPage() |
boolean |
hasPreviousPage() |
boolean |
isClosed() |
Result |
lastPage()
Scrolls to the last Page
|
Result |
nextPage()
Scrolls to the next Page
|
Result |
previousPage()
Scrolls to the previous Page
|
Result |
setRowsPerPage(int rowsPerPage)
Sets the number of rows to be shown on a page and returns the new result
of the current page.
|
public JDBCPager(JDBCConnection connection, QueryInfo queryInfo, ResultSet resultSet, int rowsPerPage) throws DBException
DBException
public DBDataSource<?> getDataSource()
getDataSource
in interface DBPager
public Result setRowsPerPage(int rowsPerPage) throws DBException
DBPager
setRowsPerPage
in interface DBPager
rowsPerPage
- int
DBException
public int getRowsPerPage()
DBPager
getRowsPerPage
in interface DBPager
int
public int getTotalRows()
DBPager
getTotalRows
in interface DBPager
int
public int getCurrentPageIndex()
DBPager
getCurrentPageIndex
in interface DBPager
int
public int getMaxPageIndex()
DBPager
getMaxPageIndex
in interface DBPager
int
public boolean hasNextPage()
hasNextPage
in interface DBPager
true
if the pager can go forwardpublic boolean hasPreviousPage()
hasPreviousPage
in interface DBPager
true
if the pager can go backwardpublic Result nextPage() throws DBException
DBPager
nextPage
in interface DBPager
DBException
public Result previousPage() throws DBException
DBPager
previousPage
in interface DBPager
DBException
public Result firstPage() throws DBException
DBPager
firstPage
in interface DBPager
DBException
public Result lastPage() throws DBException
DBPager
lastPage
in interface DBPager
DBException
public Result gotoPage(int page) throws DBException
DBPager
gotoPage
in interface DBPager
DBException
public Result gotoRow(int row) throws DBException
DBPager
gotoRow
in interface DBPager
DBException
public void close() throws DBException
DBPager
close
in interface AutoCloseable
close
in interface DBPager
DBException
public boolean isClosed() throws DBException
isClosed
in interface DBPager
true
if this pager or an underlying resource has
been closed, false
otherwiseDBException
Copyright © 2003–2022 XDEV Software. All rights reserved.