%@page language="java" import="java.sql.*"%> <% // *** Recordset Stats, Move To Record, and Go To Record: declare stats variables int Recordset1_first = 1; int Recordset1_last = 1; int Recordset1_total = -1; if (Recordset1_isEmpty) { Recordset1_total = Recordset1_first = Recordset1_last = 0; } //set the number of rows displayed on this page if (Recordset1_numRows == 0) { Recordset1_numRows = 1; } %> <% // *** Recordset Stats: if we don't know the record count, manually count them if (Recordset1_total == -1) { // count the total records by iterating through the recordset for (Recordset1_total = 1; Recordset1.next(); Recordset1_total++); // reset the cursor to the beginning Recordset1.close(); Recordset1 = StatementRecordset1.executeQuery(); Recordset1_hasData = Recordset1.next(); // set the number of rows displayed on this page if (Recordset1_numRows < 0 || Recordset1_numRows > Recordset1_total) { Recordset1_numRows = Recordset1_total; } // set the first and last displayed record Recordset1_first = Math.min(Recordset1_first, Recordset1_total); Recordset1_last = Math.min(Recordset1_first + Recordset1_numRows - 1, Recordset1_total); } %>