I’m new to programming. I’m trying to create a form that does the following in jsp/javascript
Displays 10 rows, each row containing a record if records exceeds 10, it will display the remaining records on another page.The first form will contain a link to the second form and the second form will contain the link to the first. So basically there could be infinite number of forms containing 10 rows each on each form each displaying a link to the other forms. So each page at the bottom will have something like this <<previous [1][2][3][4][5]next>>.The algorithm seems complicated and I don’t know how to generate another page for displaying the extra records. Is this complicated.Can someone please show me how this is done with the following code…HELP
thanx in advance
getchoo
Here is the code I have currently my apologize for the length. this code is called by another page:
<%@include file=“header.jsp”%>
<%@ page import=“java.sql.*” errorPage=“error.jsp”%>
<%
String connectionURL=
“jdbc:mysql://localhost:3306/studentdatabase?username=username;passwrod=password”;
Connection connection = null;
Statement statement=null;
ResultSet rs=null;
%>
<html>
<head>
<%@include file=“btechreportheader.jsp”%>
</head>
<body bgcolor=“#efefef” text=“#000000” link=“#ffcc99”>
<form name=“btechreport” method=“post” action=“deletestudent.jsp”>
<table width=“100%” border=“1” cellpadding=“2” cellspacing=“0” height=“6”>
<tr bgcolor=“#efefef”>
<td width=“8%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Date</font></div>
</td>
<td width=“10%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Student
ID</font></div>
</td>
<td width=“11%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Student
Name</font></div>
</td>
<td width=“15%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Email
Address</font></div>
</td>
<td width=“13%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Course
Taken</font></div>
</td>
<td width=“15%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Course
Uncompleted</font></div>
</td>
<td width=“6%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Qualified</font></div>
</td>
<td width=“6%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Applied</font></div>
</td>
<td width=“6%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Accepted</font></div>
</td>
<td width=“6%” height=“18”>
<div align=“center”><font face=“Verdana, Arial, Helvetica, sans-serif” size=“1”>Delete</font></div>
</td>
</tr>
<%
String separator = “-”;
String sYear = request.getParameter(“startYear”);
String sMonth= request.getParameter(“startMonth”);
String sDate = request.getParameter(“startDate”);
String startTime = sYear+separator+sMonth+separator+sDate;
String eYear = request.getParameter(“endYear”);
String eMonth= request.getParameter(“endMonth”);
String eDate= request.getParameter(“endDate”);
String endTime = eYear+separator+eMonth+separator+eDate;
Class.forName(“org.gjt.mm.mysql.Driver”).newInstance();
connection = DriverManager.getConnection(connectionURL, “”, “”);
statement = connection.createStatement();
rs=statement.executeQuery(“SELECT students.studentid, students.firstname, students.lastname, students.email,” +
“btechpre.cisy1212, btechpre.cisy2311, btechpre.cisy2313, btechpre.cisy2314, btechpre.cisy2315,” +
“credential.recdate, credential.qualified, credential.accepted, credential.applied FROM students, btechpre, credential " +
“WHERE students.studentid=credential.studentid AND credential.studentid=btechpre.studentid AND credential.recdate BETWEEN '”+startTime+”’ AND ‘“+endTime+”’ ");
//SELECT DATE_FORMAT(date,‘%M %d, %Y’) from data
while(rs.next())
{
String cisy1212=rs.getString(“cisy1212”);
String cisy2311=rs.getString(“cisy2311”);
String cisy2313=rs.getString(“cisy2313”);
String cisy2314=rs.getString(“cisy2314”);
String cisy2315=rs.getString(“cisy2315”);
%>
<tr bgcolor=“#efefef”>
<td width=“8%” height=“18”><%= rs.getString(“recdate”)%></td>
<td width=“10%” height=“18”><%= rs.getString(“studentid”)%>
<input type=“hidden” name=“studentid” value=“<%= rs.getString(“studentid”)%>”></td>
<td width=“11%” height=“18”><%=rs.getString(“firstname”)%>
<%=rs.getString(“lastname”)%></td>
<td width=“15%” height=“18”><a href=“mailto:<%=rs.getString(“email”)%>”><%=rs.getString(“email”)%></a></td>
<td width=“13%” height=“18”> <%
if((cisy1212!=null) || (cisy2311 !=null) ||(cisy2313!=null) ||(cisy2314!=null) ||(cisy2315!=null))
%> <%=cisy1212%>,<%=cisy2311%>,<%=cisy2313%>,<%=cisy2314%>,<%=cisy2315%></td>
<td width=“15%” height=“18”><%=rs.getString(“cisy1212”)%>,<%=rs.getString(“cisy2311”)%>,<%=rs.getString(“cisy2313”)%>,<%=rs.getString(“cisy2314”)%>,<%=rs.getString(“cisy2315”)%></td>
<td width=“6%” height=“18”><%=rs.getString(“qualified”)%></td>
<td width=“6%” height=“18”><%=rs.getString(“applied”)%></td>
<td width=“6%” height=“18”><%=rs.getString(“accepted”)%></td>
<td width=“6%” height=“18”>
<input style=“BACKGROUND-IMAGE: url(file://C:\jakarta-tomcat-4\webapps\CISY2415\images\ rash2.gif); WIDTH: 28px; HEIGHT: 36px; BACKGROUND-COLOR: #efefef” type=submit name=delete size=14 onClick=“alert(‘Do you want to delete the record?’)”>
</td>
</tr>
<% } //end while()
//clean up
if(rs!=null) rs.close();
if(statement!=null) statement.close();
if(connection!=null) connection.close();
%>
</table>
</form>
</body>
</html>
:eek2: :eek2: