Hi Friend,
1)select.jsp:
<%@page import="java.sql.*"%>
<%
String school=request.getParameter("school");
String class_name=request.getParameter("class_name");
System.out.println("class_name is"+class_name);
String from_year=request.getParameter("from_year");
String to_year=request.getParameter("to_year");
System.out.println(from_year+" "+to_year);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:
mysql://localhost:3306/register","root","root";);
System.out.println("First connection ok.");
System.out.println("Second connection ok.");
System.out.println("Connection created");
Statement st=con.createStatement();
System.out.println("st going to execute");
String query="SELECT * FROM student WHERE year BETWEEN '"+from_year+"' AND '"+to_year+"' and school='"+school+"'";
System.out.println(query);
System.out.println("now data are selecting");
ResultSet rs=st.executeQuery(query);
System.out.println("now data in rs.....");
System.out.println("now going to rs block............");
%>
<table>
<%
while(rs.next())
{System.out.println("yes...now in rs block............");
%>
<tr>
<td ><%=rs.getString(1)%></td>
<td ><%=rs.getString(2)%></td>
<td ><%=rs.getString(3)%></td>
<td ><%=rs.getString(4)%></td>
<td ><%=rs.getString(5)%></td>
<td ><%=rs.getString(6)%></td>
<td ><%=rs.getString(7)%></td>
</tr>
<%
}
%>
</table>
<%
rs.close();
con.close();
}catch(Exception e){out.println(e);}
%>
2)display.jsp:
<%@page import="java.sql.*"%>
<%
String school=request.getParameter("school");
String class_name=request.getParameter("class_name");
System.out.println("class_name is"+class_name);
String from_year=request.getParameter("from_year");
String to_year=request.getParameter("to_year");
System.out.println(from_year+" "+to_year);
try{
Class.forName("com.mysql.jdbc.Driver");
Connection con = DriverManager.getConnection("jdbc:
mysql://localhost:3306/register","root","root";);
System.out.println("First connection ok.");
System.out.println("Second connection ok.");
System.out.println("Connection created");
Statement st=con.createStatement();
System.out.println("st going to execute");
String query="SELECT * FROM student WHERE year BETWEEN '"+from_year+"' AND '"+to_year+"' and school='"+school+"'";
System.out.println(query);
System.out.println("now data are selecting");
ResultSet rs=st.executeQuery(query);
System.out.println("now data in rs.....");
System.out.println("now going to rs block............");
%>
<table>
<%
while(rs.next())
{System.out.println("yes...now in rs block............");
%>
<tr>
<td ><%=rs.getString(1)%></td>
<td ><%=rs.getString(2)%></td>
<td ><%=rs.getString(3)%></td>
<td ><%=rs.getString(4)%></td>
<td ><%=rs.getString(5)%></td>
<td ><%=rs.getString(6)%></td>
<td ><%=rs.getString(7)%></td>
</tr>
<%
}
%>
</table>
<%
rs.close();
con.close();
}catch(Exception e){out.println(e);}
%>
3)show.jsp:
<%@page import="java.sql.*"%>
<%
String stream=request.getParameter("stream");
out.println(stream);
%>
Thanks