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: [PATCH]Derby-229
Date Tue, 24 May 2005 19:44:26 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">
Committed this patch. <br>
<br>
Satheesh<br>
<br>
Sending&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
java\engine\org\apache\derby\impl\jdbc\EmbedResultSet.java&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
Adding&nbsp;&nbsp;&nbsp;
java\testing\org\apache\derbyTesting\functionTests\master\rsgetXXXcolumnNames.out&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Sending
java\testing\org\apache\derbyTesting\functionTests\suites\jdbcapi.runall&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Adding&nbsp;&nbsp;&nbsp;&nbsp;
java\testing\org\apache\derbyTesting\functionTests\tests\jdbcapi\rsgetXXXcolumnNames.java&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
Transmitting file data .... <br>
Committed revision
178257.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
<br>
Shreyas Kaushik wrote:<br>
<blockquote cite="mid4292EB0E.1050309@Sun.com" type="cite">Here is the
latest patch with the name changed.
  <br>
  <br>
Output of svn stat:
  <br>
-------------------
  <br>
  <br>
M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
  <br>
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
  <br>
A&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
java/testing/org/apache/derbyTesting/functionTests/master/rsgetXXXcolumnNames.out
  <br>
M&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
  <br>
  <br>
~ Shreyas
  <br>
  <br>
Satheesh Bandaram wrote:
  <br>
  <br>
  <blockquote type="cite">That probably meant new name was OK.... :-)&nbsp;
If you can submit your
    <br>
patch with your new suggestion, I will work to get this committed.
    <br>
    <br>
Satheesh
    <br>
    <br>
Shreyas Kaushik wrote:
    <br>
    <br>
&nbsp;
    <br>
    <br>
    <blockquote type="cite">I sent out a mail having a changed name and
did not receive any
      <br>
response, hence thought the existing name was ok.
      <br>
      <br>
~Shreyas
      <br>
      <br>
Satheesh Bandaram wrote:
      <br>
      <br>
&nbsp;&nbsp; <br>
      <blockquote type="cite">I thought there was a comment to rename
the test to more generic name?
        <br>
Or was it for another patch?
        <br>
        <br>
Satheesh
        <br>
        <br>
Shreyas Kaushik wrote:
        <br>
        <br>
        <br>
        <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
        <blockquote type="cite">Mamta Satoor wrote:
          <br>
          <br>
&nbsp;
          <br>
          <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          <blockquote type="cite">Hi Shreyas,
            <br>
            <br>
Thanks for taking care of the earlier review comments. I think
            <br>
existing test jdbcapi/resultset.java could have been used to add new
            <br>
tests for this bug. resultset.java tests various other JDBC apis on
            <br>
ResultSet object.
            <br>
            <br>
            <br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          </blockquote>
This is a slightly different case, hence I wanted to keep this
          <br>
seperate.
          <br>
          <br>
&nbsp;
          <br>
          <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          <blockquote type="cite">Besides that, I wondered how this
test runs in Network Server mode. It
            <br>
will be nice to have these generic JDBC tests to be run in both
            <br>
embedded and Network Server mode to cover both the Derby offerings.
            <br>
            <br>
            <br>
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          </blockquote>
I added this test to run with the jdbcapi test suite, anything else I
          <br>
need to do ?
          <br>
          <br>
If there are no other major comments I guess this can be committed,
          <br>
can someone do this ?
          <br>
          <br>
~ Shreyas
          <br>
          <br>
&nbsp;
          <br>
          <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
          <blockquote type="cite">Other than that, the patch and the
comments look good to me,
            <br>
Mamta
            <br>
            <br>
On 5/4/05, Shreyas Kaushik <a class="moz-txt-link-rfc2396E" href="mailto:Shreyas.Kaushik@sun.com">&lt;Shreyas.Kaushik@sun.com&gt;</a> wrote:
            <br>
            <br>
            <br>
&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
            <blockquote type="cite">Attached is the new patch taking
care of your comments. See inline
              <br>
for
              <br>
answers.
              <br>
              <br>
~ Shreyas
              <br>
              <br>
Satheesh Bandaram wrote:
              <br>
              <br>
              <br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              <blockquote type="cite">Thanks for the patch. Couple of
comments:
                <br>
                <br>
1. New test caseInsensitiveColumn is not part of any testsuite. So,
                <br>
&nbsp;&nbsp; the test will not get run. You would need to add this to an
                <br>
&nbsp;&nbsp; existing suite.
                <br>
                <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              </blockquote>
Taken care , will run as a part of the jdbcapi suite.
              <br>
              <br>
              <br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              <blockquote type="cite">1. Also, you should consider
enhancing an existing test script when
                <br>
&nbsp;&nbsp; adding a new test, rather than creating a new test everytime.
                <br>
&nbsp;&nbsp; This increases number of tests in a suite, taking it longer to
                <br>
&nbsp;&nbsp; run them. Instead, updating an existing test is better.
                <br>
                <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              </blockquote>
There was no test case testing this feature, since this is a new
              <br>
feature
              <br>
I added a speprate test. For Derby-203 for adding test cases I am
              <br>
working on building from the existing test cases.
              <br>
              <br>
              <br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              <blockquote type="cite">1. The patch needs to be
generated from the trunk directory, so
                <br>
&nbsp;&nbsp; your directory path wouldn't show in the patch.
                <br>
&nbsp;&nbsp; (/drivers/derby/trunk)
                <br>
                <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              </blockquote>
Done.
              <br>
              <br>
              <br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
              <blockquote type="cite">Satheesh
                <br>
                <br>
Shreyas Kaushik wrote:
                <br>
                <br>
&nbsp;
                <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
                <blockquote type="cite">Hi,
                  <br>
                  <br>
This is the latest patch.
                  <br>
I have taken care of comments from Mamta and Dan. Please let me
                  <br>
know
                  <br>
if I have missed anything.
                  <br>
                  <br>
~ Shreyas
                  <br>
                  <br>
------------------------------------------------------------------------
                  <br>
                  <br>
                  <br>
                  <br>
Index:
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
                  <br>
                  <br>
                  <br>
===================================================================
                  <br>
---
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
                  <br>
(revision 0)
                  <br>
+++
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
                  <br>
(revision 0)
                  <br>
@@ -0,0 +1,9 @@
                  <br>
+Test caseInsensitiveColumn starting
                  <br>
+Before updation...
                  <br>
+ResultSet is: 1
                  <br>
+ResultSet is: 346
                  <br>
+After update...
                  <br>
+Column Number 1: 900
                  <br>
+Column Number 2: 346
                  <br>
+Col COL1: 900
                  <br>
+Col col1: 900
                  <br>
Index: java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
                  <br>
===================================================================
                  <br>
---
                  <br>
java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(revision 165091)
                  <br>
+++
                  <br>
java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
(working copy)
                  <br>
@@ -3591,8 +3591,14 @@
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultDescription rd = resultDescription;
                  <br>
                  <br>
&nbsp; // 1 or 0 based? assume 1 (probably wrong)
                  <br>
-&nbsp;&nbsp;&nbsp;&nbsp; for (int i=rd.getColumnCount(); i&gt;=1; i--) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Changing the order in which columns are found from 1
                  <br>
till column count.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This is necessary in cases where the column names are
                  <br>
the same but are in different cases.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This is because in updateXXX and getXXX methods column
                  <br>
names are case insensitive
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // and in that case the first column should be returned.
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int columnCount = rd.getColumnCount();
                  <br>
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i = 1 ; i&lt;= columnCount;i++) {
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String name = rd.getColumnDescriptor(i).getName();
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i;
                  <br>
Index:
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
                  <br>
                  <br>
                  <br>
===================================================================
                  <br>
---
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
                  <br>
(revision 0)
                  <br>
+++
                  <br>
/drivers/derby/trunk/java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
                  <br>
(revision 0)
                  <br>
@@ -0,0 +1,97 @@
                  <br>
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
                  <br>
+
                  <br>
+
                  <br>
+import java.sql.*;
                  <br>
+
                  <br>
+import org.apache.derby.tools.ij;
                  <br>
+import org.apache.derby.tools.JDBCDisplayUtil;
                  <br>
+
                  <br>
+public class caseInsensitiveColumn {
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp; public static void main(String[] args) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test1(args);
                  <br>
+&nbsp;&nbsp;&nbsp; }
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static void test1(String []args) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection con;
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultSet rs;
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Statement stmt = null;
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PreparedStatement stmt1 = null;
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Test caseInsensitiveColumn
                  <br>
starting");
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // use the ij utility to read the
                  <br>
property file and
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // make the initial connection.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ij.getPropertyArg(args);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con = ij.startJBMS();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.setAutoCommit(false);
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt = con.createStatement();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create a table with two columns, their
                  <br>
names differ in they being in different cases.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("create table
                  <br>
caseiscol(COL1 int ,\"col1\" int)");
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.commit();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("insert into caseiscol
                  <br>
values (1,346)");
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.commit();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // select data from this table for
                  <br>
updating
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt1 = con.prepareStatement("select COL1,
                  <br>
\"col1\" from caseiscol FOR UPDATE",ResultSet.TYPE_FORWARD_ONLY,
                  <br>
ResultSet.CONCUR_UPDATABLE);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get the data and disply it before
                  <br>
updating.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Before updation...");
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("ResultSet is:
                  <br>
"+rs.getObject(1));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("ResultSet is:
                  <br>
"+rs.getObject(2));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Update the two columns with different
                  <br>
data.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Since update is case insensitive only
                  <br>
the first column should get updated in both cases.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateInt("col1",100);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateInt("COL1",900);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateRow();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("After update...");
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Display the data after updating. Only the
                  <br>
first column should have the updated value.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Column Number 1:
                  <br>
"+rs.getInt(1));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Column Number 2:
                  <br>
"+rs.getInt(2));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Again checking for case insensitive
                  <br>
behaviour here, should display the data in the first column.
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Col COL1:
                  <br>
"+rs.getInt("COL1"));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Col col1:
                  <br>
"+rs.getInt("col1"));
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch(SQLException sqle) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dumpSQLExceptions(sqle);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqle.printStackTrace();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch(Throwable e) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("FAIL -- unexpected exception:
                  <br>
"+e);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp; static private void dumpSQLExceptions (SQLException se) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("FAIL -- unexpected
                  <br>
exception");
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (se != null) {
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.println("SQLSTATE("+se.getSQLState()+"): "+se);
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; se = se.getNextException();
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
                  <br>
+}
                  <br>
                  <br>
                  <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
                </blockquote>
              </blockquote>
Index: java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
              <br>
===================================================================
              <br>
--- java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
              <br>
(revision 167869)
              <br>
+++ java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
              <br>
(working copy)
              <br>
@@ -3591,8 +3591,14 @@
              <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultDescription rd = resultDescription;
              <br>
              <br>
&nbsp;&nbsp;&nbsp; // 1 or 0 based? assume 1 (probably wrong)
              <br>
-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i=rd.getColumnCount(); i&gt;=1; i--) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Changing the order in which columns are found from 1
              <br>
till column count.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This is necessary in cases where the column names are
              <br>
the same but are in different cases.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // This is because in updateXXX and getXXX methods column
              <br>
names are case insensitive
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // and in that case the first column should be returned.
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int columnCount = rd.getColumnCount();
              <br>
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for(int i = 1 ; i&lt;= columnCount;i++) {
              <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; String name = rd.getColumnDescriptor(i).getName();
              <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
              <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return i;
              <br>
Index:
              <br>
java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
              <br>
              <br>
              <br>
===================================================================
              <br>
---
              <br>
java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
              <br>
              <br>
(revision 0)
              <br>
+++
              <br>
java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/caseInsensitiveColumn.java
              <br>
              <br>
(revision 0)
              <br>
@@ -0,0 +1,97 @@
              <br>
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
              <br>
+
              <br>
+
              <br>
+import java.sql.*;
              <br>
+
              <br>
+import org.apache.derby.tools.ij;
              <br>
+import org.apache.derby.tools.JDBCDisplayUtil;
              <br>
+
              <br>
+public class caseInsensitiveColumn {
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp; public static void main(String[] args) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; test1(args);
              <br>
+&nbsp;&nbsp;&nbsp; }
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public static void test1(String []args) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Connection con;
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ResultSet rs;
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Statement stmt = null;
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PreparedStatement stmt1 = null;
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Test caseInsensitiveColumn
              <br>
starting");
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; try
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // use the ij utility to read the property
              <br>
file and
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // make the initial connection.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ij.getPropertyArg(args);
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con = ij.startJBMS();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.setAutoCommit(false);
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt = con.createStatement();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // create a table with two columns, their
              <br>
names differ in they being in different cases.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("create table
              <br>
caseiscol(COL1 int ,\"col1\" int)");
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.commit();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt.executeUpdate("insert into caseiscol
              <br>
values (1,346)");
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; con.commit();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // select data from this table for updating
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; stmt1 = con.prepareStatement("select COL1,
              <br>
\"col1\" from caseiscol FOR UPDATE",ResultSet.TYPE_FORWARD_ONLY,
              <br>
ResultSet.CONCUR_UPDATABLE);
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Get the data and disply it before
              <br>
updating.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Before updation...");
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("ResultSet is:
              <br>
"+rs.getObject(1));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("ResultSet is:
              <br>
"+rs.getObject(2));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Update the two columns with different
              <br>
data.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Since update is case insensitive only
              <br>
the first column should get updated in both cases.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateInt("col1",100);
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateInt("COL1",900);
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.updateRow();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("After update...");
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Display the data after updating. Only the
              <br>
first column should have the updated value.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Column Number 1:
              <br>
"+rs.getInt(1));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Column Number 2:
              <br>
"+rs.getInt(2));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs = stmt1.executeQuery();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while(rs.next()) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Again checking for case insensitive
              <br>
behaviour here, should display the data in the first column.
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Col COL1:
              <br>
"+rs.getInt("COL1"));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("Col col1:
              <br>
"+rs.getInt("col1"));
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rs.close();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch(SQLException sqle) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; dumpSQLExceptions(sqle);
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; sqle.printStackTrace();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; } catch(Throwable e) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("FAIL -- unexpected exception:
              <br>
"+e.getMessage());
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; e.printStackTrace();
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp; static private void dumpSQLExceptions (SQLException se) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.out.println("FAIL -- unexpected exception");
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; while (se != null) {
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
System.out.println("SQLSTATE("+se.getSQLState()+"):
              <br>
"+se.getMessage());
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; se = se.getNextException();
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }
              <br>
+}
              <br>
Index:
              <br>
java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
              <br>
              <br>
              <br>
===================================================================
              <br>
---
              <br>
java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
              <br>
              <br>
(revision 0)
              <br>
+++
              <br>
java/testing/org/apache/derbyTesting/functionTests/master/caseInsensitiveColumn.out
              <br>
              <br>
(revision 0)
              <br>
@@ -0,0 +1,9 @@
              <br>
+Test caseInsensitiveColumn starting
              <br>
+Before updation...
              <br>
+ResultSet is: 1
              <br>
+ResultSet is: 346
              <br>
+After update...
              <br>
+Column Number 1: 900
              <br>
+Column Number 2: 346
              <br>
+Col COL1: 900
              <br>
+Col col1: 900
              <br>
Index:
              <br>
java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
              <br>
              <br>
              <br>
===================================================================
              <br>
---
              <br>
java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall&nbsp;
(revision 167869)
              <br>
+++
              <br>
java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall&nbsp;
(working copy)
              <br>
@@ -15,4 +15,4 @@
              <br>
jdbcapi/setTransactionIsolation.java
              <br>
jdbcapi/prepStmtNull.java
              <br>
jdbcapi/testRelative.java
              <br>
-
              <br>
+jdbcapi/caseInsensitiveColumn.java
              <br>
              <br>
              <br>
              <br>
              <br>
&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
            </blockquote>
          </blockquote>
&nbsp;
          <br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br>
        </blockquote>
        <br>
        <br>
&nbsp;&nbsp;&nbsp;&nbsp; <br>
      </blockquote>
      <br>
&nbsp;&nbsp; <br>
    </blockquote>
    <br>
&nbsp;
    <br>
    <br>
  </blockquote>
  <pre wrap="">
<hr size="4" width="90%">
Index: java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java
===================================================================
--- java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java	(revision 178137)
+++ java/engine/org/apache/derby/impl/jdbc/EmbedResultSet.java	(working copy)
@@ -3601,8 +3601,14 @@
 		ResultDescription rd = resultDescription;
 
     	// 1 or 0 based? assume 1 (probably wrong)
-    	for (int i=rd.getColumnCount(); i&gt;=1; i--) {
+        // Changing the order in which columns are found from 1 till column count.
+        // This is necessary in cases where the column names are the same but are in different cases.
+        // This is because in updateXXX and getXXX methods column names are case insensitive
+        // and in that case the first column should be returned.
+        
+        int columnCount = rd.getColumnCount();
 
+        for(int i = 1 ; i&lt;= columnCount;i++) {
     		String name = rd.getColumnDescriptor(i).getName();
     		if (StringUtil.SQLEqualsIgnoreCase(columnName, name)) {
     			return i;
Index: java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java	(revision 0)
+++ java/testing/org/apache/derbyTesting/functionTests/tests/jdbcapi/rsgetXXXcolumnNames.java	(revision 0)
@@ -0,0 +1,97 @@
+package org.apache.derbyTesting.functionTests.tests.jdbcapi;
+
+
+import java.sql.*;
+
+import org.apache.derby.tools.ij;
+import org.apache.derby.tools.JDBCDisplayUtil;
+
+public class rsgetXXXcolumnNames {
+
+    public static void main(String[] args) {
+        test1(args);
+    }
+    
+        public static void test1(String []args) {   
+                Connection con;
+                ResultSet rs;
+                Statement stmt = null;
+                PreparedStatement stmt1 = null;
+
+                System.out.println("Test rsgetXXXcolumnNames starting");
+
+                try
+                {
+                        // use the ij utility to read the property file and
+                        // make the initial connection.
+                        ij.getPropertyArg(args);
+                        con = ij.startJBMS();
+					
+			con.setAutoCommit(false);                        			              
+
+                        stmt = con.createStatement(); 
+
+			// create a table with two columns, their names differ in they being in different cases.
+                        stmt.executeUpdate("create table caseiscol(COL1 int ,\"col1\" int)");
+
+   			con.commit();
+   			
+			stmt.executeUpdate("insert into caseiscol values (1,346)");
+
+			con.commit();
+
+                        // select data from this table for updating
+			stmt1 = con.prepareStatement("select COL1, \"col1\" from caseiscol FOR UPDATE",ResultSet.TYPE_FORWARD_ONLY, ResultSet.CONCUR_UPDATABLE);
+		        rs = stmt1.executeQuery();
+
+			// Get the data and disply it before updating.
+                        System.out.println("Before updation...");
+			while(rs.next()) {
+			   System.out.println("ResultSet is: "+rs.getObject(1));
+			   System.out.println("ResultSet is: "+rs.getObject(2));
+			}
+                        rs.close();
+			rs = stmt1.executeQuery();
+			while(rs.next()) {
+			   // Update the two columns with different data.
+			   // Since update is case insensitive only the first column should get updated in both cases.
+			   rs.updateInt("col1",100);
+			   rs.updateInt("COL1",900);
+			   rs.updateRow();
+			}
+			rs.close();
+
+			System.out.println("After update...");
+			rs = stmt1.executeQuery();
+
+			// Display the data after updating. Only the first column should have the updated value.
+			while(rs.next()) {
+			   System.out.println("Column Number 1: "+rs.getInt(1));
+			   System.out.println("Column Number 2: "+rs.getInt(2));
+			}
+			rs.close();
+			rs = stmt1.executeQuery();
+			while(rs.next()) {
+			   // Again checking for case insensitive behaviour here, should display the data in the first column.
+			   System.out.println("Col COL1: "+rs.getInt("COL1"));
+			   System.out.println("Col col1: "+rs.getInt("col1"));
+			}
+			rs.close();
+ 		} catch(SQLException sqle) {
+ 		   dumpSQLExceptions(sqle);
+ 		   sqle.printStackTrace();
+ 		} catch(Throwable e) {
+ 		   System.out.println("FAIL -- unexpected exception: "+e.getMessage());
+                   e.printStackTrace();
+
+ 		}
+     }
+     
+     static private void dumpSQLExceptions (SQLException se) {
+                System.out.println("FAIL -- unexpected exception");
+                while (se != null) {
+                        System.out.println("SQLSTATE("+se.getSQLState()+"): "+se.getMessage());
+                        se = se.getNextException();
+                }
+        }
+}
Index: java/testing/org/apache/derbyTesting/functionTests/master/rsgetXXXcolumnNames.out
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/master/rsgetXXXcolumnNames.out	(revision 0)
+++ java/testing/org/apache/derbyTesting/functionTests/master/rsgetXXXcolumnNames.out	(revision 0)
@@ -0,0 +1,9 @@
+Test rsgetXXXcolumnNames starting
+Before updation...
+ResultSet is: 1
+ResultSet is: 346
+After update...
+Column Number 1: 900
+Column Number 2: 346
+Col COL1: 900
+Col col1: 900
Index: java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall
===================================================================
--- java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall	(revision 178137)
+++ java/testing/org/apache/derbyTesting/functionTests/suites/jdbcapi.runall	(working copy)
@@ -15,4 +15,5 @@
 jdbcapi/setTransactionIsolation.java
 jdbcapi/prepStmtNull.java
 jdbcapi/testRelative.java
+jdbcapi/rsgetXXXcolumnNames.java
 
  </pre>
</blockquote>
</body>
</html>


Mime
View raw message