When moveToCurrentRow is called and the current row is off the
authorKris Jurka <books@ejurka.com>
Fri, 22 Apr 2005 14:36:48 +0000 (14:36 +0000)
committerKris Jurka <books@ejurka.com>
Fri, 22 Apr 2005 14:36:48 +0000 (14:36 +0000)
end of the ResultSet we can't try to load that row because it
doesn't exist and will throw an Exception.

Reported by Prasanth.

src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java

index 73726bc6effd90566858e1e8efc72f0498103644..38dc25dc2b02e173b443dd200a519394d187b162 100644 (file)
@@ -699,7 +699,7 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
                        throw new PSQLException( "postgresql.updateable.notupdateable" );
                }
 
-               if (current_row < 0) {
+               if (current_row < 0 || current_row >= rows.size()) {
                        this_row = null;
                        rowBuffer = null;
                } else {