Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 28820 invoked from network); 5 Dec 2007 21:42:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 5 Dec 2007 21:42:20 -0000 Received: (qmail 52932 invoked by uid 500); 5 Dec 2007 21:42:07 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 52897 invoked by uid 500); 5 Dec 2007 21:42:07 -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 52886 invoked by uid 99); 5 Dec 2007 21:42:07 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 13:42:07 -0800 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=DNS_FROM_OPENWHOIS,SPF_HELO_PASS,SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Dec 2007 21:41:46 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1J0204-0004OR-Qs for derby-user@db.apache.org; Wed, 05 Dec 2007 13:41:48 -0800 Message-ID: <14181170.post@talk.nabble.com> Date: Wed, 5 Dec 2007 13:41:48 -0800 (PST) From: digi_pixel To: derby-user@db.apache.org Subject: Re: SqlException With Returning Data For First Row In-Reply-To: <475717E9.1070201@sun.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: napperley@gmail.com References: <14180306.post@talk.nabble.com> <47571115.6090105@sun.com> <14180728.post@talk.nabble.com> <475717E9.1070201@sun.com> X-Virus-Checked: Checked by ClamAV on apache.org The thing is that when I used the result set's first method it returned true which means I should be able to retrieve data from the current row but this is not happening. Rick Hillegas-2 wrote: > > digi_pixel wrote: >> By the way I was trying to retrieve the column using index 0. I have >> attempted to re run the application by changing the index to 1 this time, >> however a new run time error now appears: >> >> org.apache.derby.client.am.SqlException: Invalid operation to read at >> current cursor position. >> >> >> Rick Hillegas-2 wrote: >> >>> Without seeing your code, I can only speculate about what the problem >>> is. However, your problem may be that you are trying to retrieve the >>> first column using the index 0. Annoyingly, the JDBC methods use >>> 1-based, not 0-based indexing. So the first thing to verify is that you >>> are retrieving the initial column using index 1, not 0. >>> >>> Hope this helps, >>> -Rick >>> >>> >>> >> >> > Maybe you are positioned before the first row or after the last row. > Make sure that you issue a ResultSet.next() call before trying to > retrieve the first row. In general, make sure that ResultSet.next() > evaluates to true before each row that you read. When ResultSet.next() > returns false, you are at the end of the data and you will get an > exception if you try to read past the end. > > Hope this helps, > -Rick > > -- View this message in context: http://www.nabble.com/SqlException-With-Returning-Data-For-First-Row-tf4952206.html#a14181170 Sent from the Apache Derby Users mailing list archive at Nabble.com.