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

Commit4c943c8

Browse files
author
Barry Lind
committed
A little cleanup. Removing an unnecessary method.
Modified Files:jdbc/org/postgresql/jdbc2/AbstractJdbc2ResultSet.java
1 parent1cc5516 commit4c943c8

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
importorg.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-
privateint_findColumn(StringcolumnName )
1265-
{
1266-
inti;
1267-
1268-
finalintflen =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-
intoidIndex =_findColumn("oid" );
1300+
intoidIndex =0;
1301+
try {
1302+
oidIndex =findColumn("oid" );
1303+
}catch (SQLExceptionl_se) {
1304+
//Ignore if column oid isn't selected
1305+
}
13171306
inti =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
StringcolumnName =rs.getString(4);// get the columnName
1346-
13471336
intindex =findColumn(columnName );
13481337

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

14181407
ObjectvalueObject =updateValues.get(columnName);
14191408
if (valueObjectinstanceofNullObject) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp