Java.Sql.Sqlexception: Exhausted Resultset

java.sql.SQLException: Exhausted Resultset

I've seen this error while trying to access a column value after processing the resultset.

if (rs != null) {
while (rs.next()) {
count = rs.getInt(1);
}
count = rs.getInt(1); //this will throw Exhausted resultset
}

Hope this will help you :)

java.sql.SQLException: Exhausted Resultset error

Try as

if (rs! = null) { 
while (rs.next()) {
returnValue = rs.getString("display_name");
}
......

SQLException: Exhausted Resultset

result.next();

storedPassword = result.getString("passwd");

You are not checking the return value of next. If you have no rows you get into trouble...

if(result.next()){
storedPassword = result.getString("passwd");
}

Getting Exausted ResultSet Error in Java jdbc oracle

UnCOMMITted data is only visible within the session that created it (and will ROLLBACK at the end of the session if it has not been COMMITted). If you can't see the data then make sure you have issued a COMMIT command in the SQL client.

If you have issued a COMMIT and still can't see the data then make sure that both the SQL Client and the JDBC program are connecting to the same database and are querying the same user's schema of that database.



Related Topics



Leave a reply



Submit