db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mamta A. Satoor (JIRA)" <derby-...@db.apache.org>
Subject [jira] Commented: (DERBY-229) Column names on ResultSet.updateXXX and getXXX methods are handled incorrectly
Date Tue, 19 Apr 2005 04:45:46 GMT
     [ http://issues.apache.org/jira/browse/DERBY-229?page=comments#action_63128 ]
     
Mamta A. Satoor commented on DERBY-229:
---------------------------------------

The getter [updater] methods with column names (in EmbedResultSet.java) use the protected
method findColumnName(String columnName) to determine the column index for the passed column
name. And the loop for the lookup starts from the end towards the beginning of the ResultDescription
and that seems to be the problem behind the current behavior. 
	ResultDescription rd = resultDescription;

    	// 1 or 0 based? assume 1 (probably wrong)
    	for (int i=rd.getColumnCount(); i>=1; i--) {

    		String name = rd.getColumnDescriptor(i).getName();
    		if (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
    			return i;
    		}
    	}


> Column names on ResultSet.updateXXX and getXXX methods are handled incorrectly
> ------------------------------------------------------------------------------
>
>          Key: DERBY-229
>          URL: http://issues.apache.org/jira/browse/DERBY-229
>      Project: Derby
>         Type: Bug
>   Components: JDBC
>     Versions: 10.1.0.0, 10.0.2.1
>     Reporter: Daniel John Debrunner
>  Attachments: x.java
>
> Sections 14.2.3 and [14.2.3] of JDBC 3.0 spec say
> Column names supplied to getter [updater] methods are case insensitive. If a select list
> contains the same column more than once, the first instance of the column will be
> returned [updated].
> Derby returns or updates the last column in the select list, not the first. With the
attached Java class I see
> PRE-UPDATE
> 1,100
> POST-UPDATE
> 1,500
> POST-UPDATE getXXX(name)
> AB:500,ab500

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


Mime
View raw message