15
15
import org .postgresql .util .PSQLException ;
16
16
17
17
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 $
19
19
* This class defines methods of the jdbc2 specification. This class extends
20
20
* org.postgresql.jdbc1.AbstractJdbc1ResultSet which provides the jdbc1
21
21
* methods. The real Statement class (for jdbc2) is org.postgresql.jdbc2.Jdbc2ResultSet
@@ -191,10 +191,12 @@ public void beforeFirst() throws SQLException {
191
191
}
192
192
193
193
194
- public boolean first () throws SQLException {
194
+ public boolean first () throws SQLException
195
+ {
195
196
if (rows .size () <= 0 )
196
197
return false ;
197
198
199
+ onInsertRow = false ;
198
200
current_row = 0 ;
199
201
this_row = (byte [][]) rows .elementAt (current_row );
200
202
@@ -449,16 +451,19 @@ public void setFetchSize(int rows) throws SQLException {
449
451
}
450
452
451
453
452
- public synchronized void cancelRowUpdates () throws SQLException {
453
- if (doingUpdates ) {
454
+ public synchronized void cancelRowUpdates () throws SQLException
455
+ {
456
+ if (doingUpdates )
457
+ {
454
458
doingUpdates = false ;
455
459
456
460
clearRowBuffer ();
457
461
}
458
462
}
459
463
460
464
461
- public synchronized void deleteRow () throws SQLException {
465
+ public synchronized void deleteRow () throws SQLException
466
+ {
462
467
if ( !isUpdateable () ) {
463
468
throw new PSQLException ( "postgresql.updateable.notupdateable" );
464
469
}
@@ -593,12 +598,15 @@ public synchronized void moveToCurrentRow() throws SQLException {
593
598
}
594
599
595
600
596
- public synchronized void moveToInsertRow () throws SQLException {
597
- if (!updateable ) {
601
+ public synchronized void moveToInsertRow () throws SQLException
602
+ {
603
+ if ( !isUpdateable () )
604
+ {
598
605
throw new PSQLException ( "postgresql.updateable.notupdateable" );
599
606
}
600
607
601
- if (insertStatement != null ) {
608
+ if (insertStatement != null )
609
+ {
602
610
insertStatement = null ;
603
611
}
604
612
@@ -612,7 +620,8 @@ public synchronized void moveToInsertRow() throws SQLException {
612
620
}
613
621
614
622
615
- private synchronized void clearRowBuffer () throws SQLException {
623
+ private synchronized void clearRowBuffer () throws SQLException
624
+ {
616
625
// rowBuffer is the temporary storage for the row
617
626
rowBuffer = new byte [fields .length ][];
618
627
@@ -1180,7 +1189,8 @@ private int _findColumn( String columnName ) {
1180
1189
* Is this ResultSet updateable?
1181
1190
*/
1182
1191
1183
- boolean isUpdateable () throws SQLException {
1192
+ boolean isUpdateable () throws SQLException
1193
+ {
1184
1194
1185
1195
if (updateable ) return true ;
1186
1196
0 commit comments