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 "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page import="transLocate" %>
<jsp:useBean id="transView" class="trans" scope="request" />
<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="verdana,arial,helvetica,san serif">
<form name="tranSearchResults" action="Servlet" method="post">
<table border="0" cellpadding="5" cellspacing="2">
<tr>
<td style="HEIGHT: 1px; WIDTH: 75px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Date</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Account#</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Transaction</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Ref#</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Amount</b></font>
</td>
</tr>
<tr bgcolor="d2b48c">
<td style="HEIGHT: 1px; WIDTH: 75px" align="center">
04/16/2001
<%
for(int i=0;i<transView.getDates().size();i++) {
%>
<%= transView.getDates().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" align="center">
123456789
<%
for(int i=0;i<transView.getAccounts().size();i++) {
%>
<%= transView.getAccounts().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" align="center">
ACH Credits
<%
for(int i=0;i<transView.getTrans().size();i++) {
%>
<%= transView.getTrans().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" align="center">
<a href="#"><font color="#0000ff">00000000000</font>
<%
for(int i=0;i<transView.getRefs().size();i++) {
%>
<%= transView.getRefs().elementAt(i)%>
<%
}
%>
</a>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" align="center">
$123,456,789.00
<%
for(int i=0;i<transView.getAmounts().size();i++) {
%>
<%= transView.getAmounts().elementAt(i)%>
<%
}
%>
</td>
</tr>
</table>
</form>
</body>
</html>
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 "-//W3C//DTD HTML 4.0 Transitional//EN">
<%@ page import="transLocate" %>
<jsp:useBean id="transView" class="trans" scope="request" />
<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="verdana,arial,helvetica,san serif">
<form name="tranSearchResults" action="Servlet" method="post">
<table border="0" cellpadding="5" cellspacing="2">
<tr>
<td style="HEIGHT: 1px; WIDTH: 75px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Date</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Account#</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Transaction</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Ref#</b></font>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" bgcolor="#008080" align="center">
<font color="#ffffff"><b>Amount</b></font>
</td>
</tr>
<tr bgcolor="d2b48c">
<td style="HEIGHT: 1px; WIDTH: 75px" align="center">
04/16/2001
<%
for(int i=0;i<transView.getDates().size();i++) {
%>
<%= transView.getDates().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" align="center">
123456789
<%
for(int i=0;i<transView.getAccounts().size();i++) {
%>
<%= transView.getAccounts().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 150px" align="center">
ACH Credits
<%
for(int i=0;i<transView.getTrans().size();i++) {
%>
<%= transView.getTrans().elementAt(i)%>
<%
}
%>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" align="center">
<a href="#"><font color="#0000ff">00000000000</font>
<%
for(int i=0;i<transView.getRefs().size();i++) {
%>
<%= transView.getRefs().elementAt(i)%>
<%
}
%>
</a>
</td>
<td style="HEIGHT: 1px; WIDTH: 110px" align="center">
$123,456,789.00
<%
for(int i=0;i<transView.getAmounts().size();i++) {
%>
<%= transView.getAmounts().elementAt(i)%>
<%
}
%>
</td>
</tr>
</table>
</form>
</body>
</html>