Take the total number of articles
statement = Conn.createstatement ();
pagers = Statement.executequery (pagesql);
while (Pagers.next ())
{
Allcol = Pagers.getint (1);
System.out.println (Allcol);
}
Get the number of pages
Allpage = (int) Math.ceil (allcol + ipage-1)/ipage);
Whether the number of pages is empty
if (Request.getparameter ("pages") ==null) {
Pages=1;
} else {
pages = new Integer (Request.getparameter ("pages")). Intvalue ();
SYSTEM.OUT.PRINTLN (pages);
}
To judge the front page
if (pages > Allpage | | pages = 0)
{cpage = 1;}
Else
{
cpage = pages;
}
The starting page is judged
sql = ' Select top ' +ipage+ ' au_id,au_lname,au_fname,address,phone from authors where au_id ' not in ' (select Top + (cpage-1) * Ipage+ "au_id from authors order BY au_id Desc", ORDER BY au_id DESC ";
rs = statement.executequery (SQL);
while (Rs.next ())
{
Au_id=rs.getstring ("au_id");
Au_lname=rs.getstring ("au_lname");
Au_fname=rs.getstring ("au_fname");
Phone=rs.getstring ("Phone");
Address=rs.getstring ("Address");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.