Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4c943c8

Browse files
author
Barry Lind
committed
A little cleanup. Removing an unnecessary method.
Modified Files: jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
1 parent 1cc5516 commit 4c943c8

File tree

1 file changed

+9
-20
lines changed

1 file changed

+9
-20
lines changed

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

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import org.postgresql.util.PSQLException;
1616

1717

18-
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.13 2003/02/04 09:20:10 barry Exp $
18+
/* $Header: /cvsroot/pgsql/src/interfaces/jdbc/org/postgresql/jdbc2/Attic/AbstractJdbc2ResultSet.java,v 1.14 2003/02/27 05:56:27 barry 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
@@ -1261,22 +1261,6 @@ public synchronized void updateObject(String columnName, Object x)
12611261
}
12621262

12631263

1264-
private int _findColumn( String columnName )
1265-
{
1266-
int i;
1267-
1268-
final int flen = fields.length;
1269-
for (i = 0; i < flen; ++i)
1270-
{
1271-
if (fields[i].getName().equalsIgnoreCase(columnName))
1272-
{
1273-
return (i + 1);
1274-
}
1275-
}
1276-
return -1;
1277-
}
1278-
1279-
12801264
/**
12811265
* Is this ResultSet updateable?
12821266
*/
@@ -1313,12 +1297,18 @@ boolean isUpdateable() throws SQLException
13131297

13141298

13151299
usingOID = false;
1316-
int oidIndex = _findColumn( "oid" );
1300+
int oidIndex = 0;
1301+
try {
1302+
oidIndex = findColumn( "oid" );
1303+
} catch (SQLException l_se) {
1304+
//Ignore if column oid isn't selected
1305+
}
13171306
int i = 0;
13181307

13191308

13201309
// if we find the oid then just use it
13211310

1311+
//oidIndex will be >0 if the oid was in the select list
13221312
if ( oidIndex > 0 )
13231313
{
13241314
i++;
@@ -1343,7 +1333,6 @@ boolean isUpdateable() throws SQLException
13431333
for (; rs.next(); i++ )
13441334
{
13451335
String columnName = rs.getString(4); // get the columnName
1346-
13471336
int index = findColumn( columnName );
13481337

13491338
if ( index > 0 )
@@ -1413,7 +1402,7 @@ private void updateRowBuffer() throws SQLException
14131402
while ( columns.hasMoreElements() )
14141403
{
14151404
String columnName = (String) columns.nextElement();
1416-
int columnIndex = _findColumn( columnName ) - 1;
1405+
int columnIndex = findColumn( columnName ) - 1;
14171406

14181407
Object valueObject = updateValues.get(columnName);
14191408
if (valueObject instanceof NullObject) {

0 commit comments

Comments
 (0)