Examples I used in the JSP page
<% @ Page ContentType = "Text / HTML; Charset = UTF-8"%>
<% @ Page Import = "DB. *"%>
JSP1
 title>
 hEAD>
<% //
StringBuffer s = new stringbuffer (); //
S.Append ("Select * from Employee Where 1 = 1"); // bean.viewQueryBean
IF (Request.GetParameter ("condition")! = null)
{S.Append ("and");
S.Append (Request.GetParameter ("condition");
}
PageResultSet P = new pageresultset ();
P.ExecuteQuery (S.toString ());
INT PG, PageRows, PageCount;
PageCount = p.getPageCount ();
System.out.println (PageCount);
IF (Request.GetParameter ("Page")! = null) {
PG = Integer.Parseint (Request.getParameter ("Page"));
Else {pg = 1;}
PageRows = p.getpageROWS ();
P. ScrollTorows ((PG-1) * PageRows   1);
INT i = 1;
DO
{OUT.PRINTLN (p.getstring (1));
System.out.print (p.getstring (2)); i   ;
WHIL (P.Next () && i <= PageROWS);
p.Close ();
%>
 table>
  =% = pg%> 椤? ???% = PageCount%> 椤? / div>  tr>
 
<% IF (PG 
?? 椤? / a>
<%}%>
<% for (int J = 1; j <= pagecount; j   )
{Out.print (" ["   j   "] ");}%>  div>
 TR>
 table>
 body>
 html>
 
转载请注明原文地址:https://www.9cbs.com/read-107021.html