]> granicus.if.org Git - postgresql/commitdiff
When positioned before the start of a ResultSet issuing relative(0)
authorKris Jurka <books@ejurka.com>
Mon, 18 Apr 2005 18:25:11 +0000 (18:25 +0000)
committerKris Jurka <books@ejurka.com>
Mon, 18 Apr 2005 18:25:11 +0000 (18:25 +0000)
results in an exception being thrown when it really should be a
no-op.

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

index 263524f2fd1921eb68b2600826272c1fbd7b2800..8363b1390f26995b9a62628659e562190cae5cf3 100644 (file)
@@ -9,7 +9,7 @@
  * Copyright (c) 2003, PostgreSQL Global Development Group
  *
  * IDENTIFICATION
- *       $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.9 2004/09/13 07:14:26 jurka Exp $
+ *       $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.25.2.10 2005/04/18 18:25:11 jurka Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -176,8 +176,10 @@ public abstract class AbstractJdbc2ResultSet extends org.postgresql.jdbc1.Abstra
                // index is 1-based, but internally we use 0-based indices
                int internalIndex;
 
-               if (index == 0)
-                       throw new SQLException("Cannot move to index of 0");
+               if (index == 0) {
+                       beforeFirst();
+                       return false;
+               }
 
                final int rows_size = rows.size();