Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit881390f

Browse files
author
Dave Cramer
committed
patch to allow insertRow on an empty resultSet
1 parent6a5168a commit881390f

File tree

1 file changed

+20
-10
lines changed

1 file changed

+20
-10
lines changed

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

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
importorg.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-
publicbooleanfirst()throwsSQLException {
194+
publicbooleanfirst()throwsSQLException
195+
{
195196
if (rows.size() <=0)
196197
returnfalse;
197198

199+
onInsertRow =false;
198200
current_row =0;
199201
this_row = (byte[][])rows.elementAt(current_row);
200202

@@ -449,16 +451,19 @@ public void setFetchSize(int rows) throws SQLException {
449451
}
450452

451453

452-
publicsynchronizedvoidcancelRowUpdates()throwsSQLException {
453-
if (doingUpdates) {
454+
publicsynchronizedvoidcancelRowUpdates()throwsSQLException
455+
{
456+
if (doingUpdates)
457+
{
454458
doingUpdates =false;
455459

456460
clearRowBuffer();
457461
}
458462
}
459463

460464

461-
publicsynchronizedvoiddeleteRow()throwsSQLException {
465+
publicsynchronizedvoiddeleteRow()throwsSQLException
466+
{
462467
if ( !isUpdateable() ) {
463468
thrownewPSQLException("postgresql.updateable.notupdateable" );
464469
}
@@ -593,12 +598,15 @@ public synchronized void moveToCurrentRow() throws SQLException {
593598
}
594599

595600

596-
publicsynchronizedvoidmoveToInsertRow()throwsSQLException {
597-
if (!updateable) {
601+
publicsynchronizedvoidmoveToInsertRow()throwsSQLException
602+
{
603+
if ( !isUpdateable() )
604+
{
598605
thrownewPSQLException("postgresql.updateable.notupdateable" );
599606
}
600607

601-
if (insertStatement !=null) {
608+
if (insertStatement !=null)
609+
{
602610
insertStatement =null;
603611
}
604612

@@ -612,7 +620,8 @@ public synchronized void moveToInsertRow() throws SQLException {
612620
}
613621

614622

615-
privatesynchronizedvoidclearRowBuffer()throwsSQLException {
623+
privatesynchronizedvoidclearRowBuffer()throwsSQLException
624+
{
616625
// rowBuffer is the temporary storage for the row
617626
rowBuffer =newbyte[fields.length][];
618627

@@ -1180,7 +1189,8 @@ private int _findColumn( String columnName ) {
11801189
* Is this ResultSet updateable?
11811190
*/
11821191

1183-
booleanisUpdateable()throwsSQLException {
1192+
booleanisUpdateable()throwsSQLException
1193+
{
11841194

11851195
if (updateable)returntrue;
11861196

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp