From derby-user-return-5792-apmail-db-derby-user-archive=db.apache.org@db.apache.org Thu Dec 07 01:12:28 2006 Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 75311 invoked from network); 7 Dec 2006 01:12:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Dec 2006 01:12:27 -0000 Received: (qmail 38443 invoked by uid 500); 7 Dec 2006 01:12:30 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 38403 invoked by uid 500); 7 Dec 2006 01:12:29 -0000 Mailing-List: contact derby-user-help@db.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: List-Id: Reply-To: "Derby Discussion" Delivered-To: mailing list derby-user@db.apache.org Received: (qmail 38364 invoked by uid 99); 7 Dec 2006 01:12:27 -0000 X-ASF-Spam-Status: No, hits=2.1 required=10.0 tests=DATE_IN_PAST_12_24,RCVD_IN_SORBS_WEB,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: domain of kartha02@gmail.com designates 66.249.82.233 as permitted sender) Received: from [66.249.82.233] (HELO wx-out-0506.google.com) (66.249.82.233) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 06 Dec 2006 17:12:21 -0800 Received: by wx-out-0506.google.com with SMTP id s18so346204wxc for ; Wed, 06 Dec 2006 17:10:30 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:user-agent:x-accept-language:mime-version:to:subject:references:in-reply-to:content-type:content-transfer-encoding; b=oRbBwVscZZxY1BzDRfx3q2G+pn0VGS9HKGznoH5CLjp8kbs8nLA10HTRcU2igHWS+Z973Wk3gV8lXxM5qwzD7YFcmy20THXY/Z3RIBOMwKmSw1y2FecG1mS6YbhixrjYtG58iIEt3fZhGokV/kdO6pnAnA+PoTuc6J69P3HVbz0= Received: by 10.70.109.12 with SMTP id h12mr2492152wxc.1165453830671; Wed, 06 Dec 2006 17:10:30 -0800 (PST) Received: from ?9.72.133.58? ( [32.97.110.142]) by mx.google.com with ESMTP id 67sm43646635wra.2006.12.06.17.10.28; Wed, 06 Dec 2006 17:10:29 -0800 (PST) Message-ID: <4576C13F.9080202@gmail.com> Date: Wed, 06 Dec 2006 05:10:23 -0800 From: Rajesh Kartha User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.12) Gecko/20050915 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Discussion Subject: Re: Tablealias as column qualifier in resultset References: <200612050905.07560.per.newgro@gmx.ch> In-Reply-To: <200612050905.07560.per.newgro@gmx.ch> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Per Newgro wrote: >Hi, > >i've a little question. >If i execute the example-statement > > SELECT MYTABLE.* FROM myTable MYTABLE WHERE MYTABLE:A = 5; > >i expected to access the column in resultset by usage of > > Object o = getObject("MYTABLE.A); > >But this is throwing a ColumnNotFoundException. The other access is working. > > Object o = getObject("A); > >I'm a little bit confused because how is derby solving same column names in a >join of two tables, if the columns are not referenced by the qualifier? > >Cheers >Per > > > Hello Per, I have never seen any examples of using "tableName.columnName" with the ResultSet.getObject() method. My understanding is the ResultSet.getObject () is expected to use only the column names, hence using the table name qualifier will not work. Using only the column names should be right approach as you noticed (getObject("A")) For cases where the same column names appear in joins of two tables, I would qualify those columns with the respective tables in the query and use the *getObject*(int columnIndex) instead: Example; select a.b,b.b from a, b where a.a=b.a HTH, Rajesh