java.sql.SQLException: [Microsoft][ODBC Driver Manager] Invalid cursor stat
843854Jan 16 2004 — edited May 7 2006Hello All,
I am facing a very simple but major problem...
when i am trying to fetch the max(id) from a employee table it is giving me
.Invalid Cursor State Error .The part of the code which is giving error is:
str="select isnull(max(id),0) from Employee";
rs=st.executeQuery(str);
rs.next();
int id=rs.getInt(1);
rs.close();
I'm using a bean to connect to a database, in this case SQL Server 7 . And all other programs work fine in the application , apart from this so their is no problem with the bean.
I had not used while because ResultSet will contain only one record.
Please, provide ur valuable suggestion.
thanx in advance
Shaman