SQL QUERY IN JSP PAGE
843838Nov 26 2006 — edited Jul 30 2007Dear Friends,
There is a table named as EXPENSES having fields as sl_no, name.
I want to find the MAXIMUM value of the sl_no.
For that i am using the query as " SELECT MAX(sl_no) FROM EXPENSES "
In JSP file my code is ......................
ResultSet rs= stmt.executeQuery(" SELECT MAX(sl_no) FROM EXPENSES ");
if(rs.next()) {
out.println(rs.getInt("sl_no"));
}
this out.println line throws a exception as "column not found"
My aim is just to find the maximu value of a field from a table by using the jsp as a front end.
So please reply me how can I slove that problem.