1515import org .postgresql .util .PSQLException ;
1616
1717
18- /* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.5 2002/08/23 20:45:49 barry Exp $
18+ /* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.6 2002/09/01 23:40:36 davec Exp $
1919 * This class defines methods of the jdbc2 specification. This class extends
2020 * org.postgresql.jdbc1.AbstractJdbc1ResultSet which provides the jdbc1
2121 * methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2ResultSet
@@ -191,10 +191,12 @@ public void beforeFirst() throws SQLException {
191191 }
192192
193193
194- public boolean first ()throws SQLException {
194+ public boolean first ()throws SQLException
195+ {
195196if (rows .size () <=0 )
196197return false ;
197198
199+ onInsertRow =false ;
198200current_row =0 ;
199201this_row = (byte [][])rows .elementAt (current_row );
200202
@@ -449,16 +451,19 @@ public void setFetchSize(int rows) throws SQLException {
449451 }
450452
451453
452- public synchronized void cancelRowUpdates ()throws SQLException {
453- if (doingUpdates ) {
454+ public synchronized void cancelRowUpdates ()throws SQLException
455+ {
456+ if (doingUpdates )
457+ {
454458doingUpdates =false ;
455459
456460clearRowBuffer ();
457461 }
458462 }
459463
460464
461- public synchronized void deleteRow ()throws SQLException {
465+ public synchronized void deleteRow ()throws SQLException
466+ {
462467if ( !isUpdateable () ) {
463468throw new PSQLException ("postgresql.updateable.notupdateable" );
464469 }
@@ -593,12 +598,15 @@ public synchronized void moveToCurrentRow() throws SQLException {
593598 }
594599
595600
596- public synchronized void moveToInsertRow ()throws SQLException {
597- if (!updateable ) {
601+ public synchronized void moveToInsertRow ()throws SQLException
602+ {
603+ if ( !isUpdateable () )
604+ {
598605throw new PSQLException ("postgresql.updateable.notupdateable" );
599606 }
600607
601- if (insertStatement !=null ) {
608+ if (insertStatement !=null )
609+ {
602610insertStatement =null ;
603611 }
604612
@@ -612,7 +620,8 @@ public synchronized void moveToInsertRow() throws SQLException {
612620 }
613621
614622
615- private synchronized void clearRowBuffer ()throws SQLException {
623+ private synchronized void clearRowBuffer ()throws SQLException
624+ {
616625// rowBuffer is the temporary storage for the row
617626rowBuffer =new byte [fields .length ][];
618627
@@ -1180,7 +1189,8 @@ private int _findColumn( String columnName ) {
11801189 * Is this ResultSet updateable?
11811190 */
11821191
1183- boolean isUpdateable ()throws SQLException {
1192+ boolean isUpdateable ()throws SQLException
1193+ {
11841194
11851195if (updateable )return true ;
11861196