I use two ResultSet , One in the another one.
try
{
con1 = DriverManager.getConnection ("jdbc:odbc:java");
smt1=con.createStatement();
if(sele.equals("ALL"))
{
rs=smt.executeQuery("select * from Stations where State='"+st+"'");
}
else
{
rs=smt.executeQuery("select * from Stations where City='"+sele+"'");
}
while(rs.next())
{
stid=rs.getString(1);
ofid=rs.getString(2);
name=rs.getString(3);
num=rs.getString(4);
des=rs.getString(5);
dis=rs.getString(6);
%>
<tr style="border: blue dotted thick">
<td style="border: blue dotted thin" align="center" ><a style="color: red;" href="view.jsp?<%=stid%>" ><%=stid%></a></td>
<td style="border: blue dotted thin" align="center"><%=ofid%></td>
<td style="border: blue dotted thin" align="center"><%=dis%></td>
<td style="border: blue dotted thin; " align="center">
<%=name%> </td>
<td style="border: blue dotted thin" align="center"><%=num%></td>
<td style="border: blue dotted thin" align="center"><%=des%></td>
<%
rs1=smt.executeQuery("Select Count(*) from Officer where Station_ID='"+stid+"'");
while(rs1.next()){
coun=rs1.getString(1);
}
%>
<td style="border: blue dotted thin" align="center"><%=coun%></td>
</tr>
<%
}
}
catch(Exception ex)
{
out.println(ex);
}
But it give an Error -ResultSet Closed ..
Please Help me out , and tell me how use Resultset Within the Resultset????