| Query database |
| ResultSet rx = statement. executeQuery(“select count() from items”) |
| Rx.next() |
| Recordcount = rx.getInt(1); |
| Rx = statement.executeQuery (SELECT image-url, author, price,item-id FROM Items ORDER BYitem-id DESC LIMIT” + StartRow+”,” + PageSize); |
| Address of destination page |
| Out. Print(“[“); |
| For(int c = CounterStart;c<CounterEnd;c++){ |
| If(c<MaxPageone) { |
| If(c = Pageone) { |
| If(c % Pagesize =1) { |
| Outtest.print(c); |
| }else{ |
| Outtest.print(c+”,”); |
| } |
| } else if (c % Pagesize =1) { |
| Outtest.print(“<ahref = TestPage, jsp? Page None=”+c+”> ”+c+”</a>”) |
| }else{ |
| Outtest.print(“<ahref = TestPage, jsp? Page None=”+c+”> ”+c+”</a>,”); |
| } |
| }else{ |
| If(PageNone<MaxPageone) {/ |
| Outtest.print(c); |
| Break; |
| }else{ |
| Outtest.print(“<ahref = TestPage, jsp? Page None=”+c+”> ”+c+”</a>,”); |
| Break; |
| } |
| } |
| } |
| Outtest.print(“J”); |
| Data display codes are as follows. |
| <table width = “100%” border = “0” class = “Normal TableOne”> |
| <tr> |
| <td class = “InternalHder”>Number</td> |
| <td class = “InternalHder”>Login name</td> |
| <td class = “InternalHder”>Login time</td> |
| <tr> |
| <% |
| Int i =1; |
| While (rx.nest()){ |
| Int bil = i + (pageNo-1)PageSize; |
| %> |
| <tr> |
| <td class = “Normal TableOne”><% = bil%></td> |
| <td class = “Normal TableOne”><% = rx.getstring(1)%></td> |
| <td class = “Normal TableOne”><% = rx.getstring(2)%></td> |
| <td class = “Normal TableOne”><% = rx.getstring(3)%></td> |
| <tr> |
| <% |
| i++ |
| }%> |
| </table> |