Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Records returned per page

Status
Not open for further replies.

timmbo

Programmer
Feb 22, 2001
167
US
Hi All,
My database can return 100s of rows. I need to count each row and if it equals 50 rows, show next 50 rows on new page and so on. How would I go about doing this. I am VERY new to Java and JSP's so, any and all help welcome. Thanks!!

Enclosed, is my jsp (transSearchResults.jsp).

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0 Transitional//EN&quot;>

<%@ page import=&quot;transLocate&quot; %>
<jsp:useBean id=&quot;transView&quot; class=&quot;trans&quot; scope=&quot;request&quot; />

<html>
<head>
<title>Trans Search Results Page</title>
<!--This also calls transDescGet.java to retrieve information
from this jsp and load it to transSearchResultsWithDesc.jsp.-->
</head>
<body>
<font face=&quot;verdana,arial,helvetica,san serif&quot;>
<form name=&quot;tranSearchResults&quot; action=&quot;Servlet&quot; method=&quot;post&quot;>
<table border=&quot;0&quot; cellpadding=&quot;5&quot; cellspacing=&quot;2&quot;>
<tr>
<td style=&quot;HEIGHT: 1px; WIDTH: 75px&quot; bgcolor=&quot;#008080&quot; align=&quot;center&quot;>
<font color=&quot;#ffffff&quot;><b>Date</b></font>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 150px&quot; bgcolor=&quot;#008080&quot; align=&quot;center&quot;>
<font color=&quot;#ffffff&quot;><b>Account#</b></font>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 150px&quot; bgcolor=&quot;#008080&quot; align=&quot;center&quot;>
<font color=&quot;#ffffff&quot;><b>Transaction</b></font>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 110px&quot; bgcolor=&quot;#008080&quot; align=&quot;center&quot;>
<font color=&quot;#ffffff&quot;><b>Ref#</b></font>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 110px&quot; bgcolor=&quot;#008080&quot; align=&quot;center&quot;>
<font color=&quot;#ffffff&quot;><b>Amount</b></font>
</td>
</tr>
<tr bgcolor=&quot;d2b48c&quot;>
<td style=&quot;HEIGHT: 1px; WIDTH: 75px&quot; align=&quot;center&quot;>
04/16/2001
<%
for(int i=0;i<transView.getDates().size();i++) {
%>
<%= transView.getDates().elementAt(i)%>
<%
}
%>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 150px&quot; align=&quot;center&quot;>
123456789
<%
for(int i=0;i<transView.getAccounts().size();i++) {
%>
<%= transView.getAccounts().elementAt(i)%>
<%
}
%>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 150px&quot; align=&quot;center&quot;>
ACH Credits
<%
for(int i=0;i<transView.getTrans().size();i++) {
%>
<%= transView.getTrans().elementAt(i)%>
<%
}
%>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 110px&quot; align=&quot;center&quot;>
<a href=&quot;#&quot;><font color=&quot;#0000ff&quot;>00000000000</font>
<%
for(int i=0;i<transView.getRefs().size();i++) {
%>
<%= transView.getRefs().elementAt(i)%>
<%
}
%>
</a>
</td>
<td style=&quot;HEIGHT: 1px; WIDTH: 110px&quot; align=&quot;center&quot;>
$123,456,789.00
<%
for(int i=0;i<transView.getAmounts().size();i++) {
%>
<%= transView.getAmounts().elementAt(i)%>
<%
}
%>
</td>
</tr>
</table>
</form>
</body>
</html>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top