I am trying the following jsp code.
switch(ch)
{
case 1 :
ResultSet rsid=stmt.executeQuery("select ID from BcTwo");
while(rsid.next())
{
%>
<tr><td>
<%out.println(rsid.getString(1)); %>
</td></tr>
<%
}
rsid.close();
break;
case 2 :
ResultSet rs=stmt.executeQuery("select SERIES from BcTwo");
while(rs.next())
{
%>
<tr><td>
<%out.println(rs.getString("SERIES")); %>
</td></tr>
<%
}
rs.close();
break;
}
Using this code I am able to print the data.But I want the data to be printed in following format :
ID Series
1 BE
2 EQ
3 BE
4 BE
5 EQ
6 EQ
And using the above code data is getting printed as :
ID
1
2
3
4
5
6
Series
BE
EQ
BE
BE
EQ
EQ
What changes I should make to get the required output?
I got the answer.
I am not sure whether this is the best solution but it just worked for me.