I am a beginner. In my project I am using Java and Mysql. While doing a code I got an error. That code is mentioning below
<%
ResultSet rs=s.fetchtask(userid);
while(rs.next())
{
%>
<table border="1">
<tr><td>
<% int qnid=(rs.getInt("question_id"));
ResultSet rs1=s.fetchqn(qnid);
String qn=rs1.getString("question");
%>
<% out.println(qn);%>
</td></tr>
</table>
<%
}
%>
But when I am not using the second fetch its working
<%
ResultSet rs=s.fetchtask(userid);
while(rs.next())
{
%>
<table border="1">
<tr><td>
<% int qnid=(rs.getInt("question_id"));
%>
<% out.println(qnid);%>
</td></tr>
</table>
<%
}
%>
When I am using this code there is no problem. Please somebody help me. The error showing is
org.apache.jasper.JasperException: An exception occurred processing JSP page /setter.jsp at line 142
139: // ResultSet rs1 = st.executeQuery("SELECT * FROM temp_qb WHERE question_id="+qnid+"");
140: ResultSet rs1=s.fetchqn(qnid);
141: // ResultSet rs1=s.fetchqn(qnid);
142: String qn=rs1.getString("question");
143: %>
144: <% //out.println(qn);
145: %>