Index: src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java =================================================================== RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java,v retrieving revision 1.13 diff -c -r1.13 AbstractJdbc2ResultSet.java *** src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 2003/02/04 09:20:10 1.13 --- src/interfaces/jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java 2003/02/05 15:36:15 *************** *** 38,44 **** protected PreparedStatement deleteStatement = null; private PreparedStatement selectStatement = null; ! public AbstractJdbc2ResultSet(Statement statement, Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor) { super (statement, fields, tuples, status, updateCount, insertOID, binaryCursor); --- 38,44 ---- protected PreparedStatement deleteStatement = null; private PreparedStatement selectStatement = null; ! public AbstractJdbc2ResultSet(Statement statement, Field[] fields, Vector tuples, String status, int updateCount, long insertOID, boolean binaryCursor) { super (statement, fields, tuples, status, updateCount, insertOID, binaryCursor); *************** *** 151,156 **** --- 151,158 ---- public boolean absolute(int index) throws SQLException { + onInsertRow = false; + // index is 1-based, but internally we use 0-based indices int internalIndex; *************** *** 193,198 **** --- 195,202 ---- public void afterLast() throws SQLException { + onInsertRow = false; + final int rows_size = rows.size(); if (rows_size > 0) current_row = rows_size; *************** *** 201,206 **** --- 205,212 ---- public void beforeFirst() throws SQLException { + onInsertRow = false; + if (rows.size() > 0) current_row = -1; } *************** *** 455,460 **** --- 461,467 ---- public boolean last() throws SQLException { + onInsertRow = false; final int rows_size = rows.size(); if (rows_size <= 0) return false; *************** *** 471,476 **** --- 478,485 ---- public boolean previous() throws SQLException { + onInsertRow = false; + if (--current_row < 0) return false; this_row = (byte[][]) rows.elementAt(current_row); *************** *** 479,484 **** --- 488,500 ---- } + public boolean next() throws SQLException + { + onInsertRow = false; + return super.next(); + } + + public boolean relative(int rows) throws SQLException { //have to add 1 since absolute expects a 1-based index *************** *** 664,673 **** throw new PSQLException( "postgresql.updateable.notupdateable" ); } ! this_row = (byte[][]) rows.elementAt(current_row); ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); onInsertRow = false; doingUpdates = false; --- 680,692 ---- throw new PSQLException( "postgresql.updateable.notupdateable" ); } ! if(current_row != -1) ! { ! this_row = (byte[][]) rows.elementAt(current_row); ! rowBuffer = new byte[this_row.length][]; ! System.arraycopy(this_row, 0, rowBuffer, 0, this_row.length); ! } onInsertRow = false; doingUpdates = false; *************** *** 1421,1427 **** } else { ! switch ( connection.getSQLType( fields[columnIndex].getPGType() ) ) { --- 1440,1446 ---- } else { ! switch ( connection.getSQLType( fields[columnIndex].getPGType() ) ) {