Guy i am trying to make a online
test website on
jsp and am using a servelet to handle the result but when i execute the code it shows a invalid cursor error and i seriously don't know what the hell is wrong help me out please !!!
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:mydata");
ResultSet rs;
PreparedStatement pst;
score=0;
for(int i=1;i<=num;i++)
{
ansgiven=request.getParameter(Integer.toString(i));
statement="select * from test where qnum = "+i ;
out.print(statement) ;
pst=con.prepareStatement(statement);
rs=pst.executeQuery();
ans=rs.getString("answer");
if(ans.equals(ansgiven))
{
score++;
}
}
The error is in this code only !!!
help me out please