db-derby-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Satheesh Bandaram <sathe...@Sourcery.Org>
Subject Re: [jira] Commented: (DERBY-229) Column names on ResultSet.updateXXX and getXXX methods are handled incorrectly
Date Tue, 19 Apr 2005 18:23:59 GMT
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
  <title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Looks like this bug has all the information needed to reproduce and to
generate a patch. Is there any interest to submit a patch for this
relatively easy fix? A complete patch would include a fix, along the
general idea provided here and a test case added to jdbcapi test suite.
Good opportunity for anyone wanting to get started modifying Derby
code. Any volunteers? <span class="moz-smiley-s1"><span> :-) </span></span><br>
<br>
I am willing to help, if needed.<br>
<br>
Satheesh<br>
<br>
Mamta A. Satoor (JIRA) wrote:<br>
<blockquote
 cite="mid61394903.1113885946666.JavaMail.jira@ajax.apache.org"
 type="cite">
  <pre wrap="">     [ <a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/DERBY-229?page=comments#action_63128">http://issues.apache.org/jira/browse/DERBY-229?page=comments#action_63128</a>
]
     
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&gt;=1; i--) {

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


  </pre>
  <blockquote type="cite">
    <pre wrap="">Column names on ResultSet.updateXXX and getXXX methods are handled
incorrectly
------------------------------------------------------------------------------

         Key: DERBY-229
         URL: <a class="moz-txt-link-freetext" href="http://issues.apache.org/jira/browse/DERBY-229">http://issues.apache.org/jira/browse/DERBY-229</a>
     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
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
</blockquote>
</body>
</html>


Mime
View raw message