Hi,
I am usind
servlet to inser values in Result database.It's working fine.But when I retrive data .It only select one record and then raise exception as No data found
code is as below..
--------------------------------------------
try
{
rs =st.executeQuery("select mark from Result");
out.println("after executing query " + "<P>");
while(rs.next())
{
out.println(rs.getInt("Mark"));
/** after this statement it raises exception and comes out of while and print marks obtained ststement **/
count = count+ rs.getInt("Mark");
out.println("after adding marks to count");
out.println("count " + count + "<P>");
out.println("Marks from database ......" + rs.getInt("Mark") + "<P>");
}
}catch(SQLException e)
{
out.println(e.getMessage());
}
}
out.println("marks obtained : " + count);
--------------------------------------------------
Rusult dabase has total 5 records.Why is it fetching only one record?
--
Padmashree