Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 12234 invoked from network); 18 Mar 2008 23:04:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 18 Mar 2008 23:04:26 -0000 Received: (qmail 17176 invoked by uid 500); 18 Mar 2008 23:04:22 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 17159 invoked by uid 500); 18 Mar 2008 23:04:22 -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 17148 invoked by uid 99); 18 Mar 2008 23:04:22 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 16:04:22 -0700 X-ASF-Spam-Status: No, hits=2.6 required=10.0 tests=RCVD_NUMERIC_HELO,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of gcaddu-derby-user@m.gmane.org designates 80.91.229.2 as permitted sender) Received: from [80.91.229.2] (HELO ciao.gmane.org) (80.91.229.2) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 18 Mar 2008 23:03:34 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1JbkqR-0003eP-Qi for derby-user@db.apache.org; Tue, 18 Mar 2008 23:03:47 +0000 Received: from 90.208.12.175 ([90.208.12.175]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Mar 2008 23:03:47 +0000 Received: from markahiles by 90.208.12.175 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 18 Mar 2008 23:03:47 +0000 X-Injected-Via-Gmane: http://gmane.org/ To: derby-user@db.apache.org From: Mark Hiles Subject: Re: Re-using an existing db and archiving data Date: Tue, 18 Mar 2008 23:03:40 +0000 (UTC) Lines: 19 Message-ID: References: <47DED655.8090305@fastmail.fm> <47DEF5F3.9080501@sun.com> <16112414.post@talk.nabble.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: main.gmane.org User-Agent: Loom/3.14 (http://gmane.org/) X-Loom-IP: 90.208.12.175 (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.12) Gecko/20080215 Ubuntu/7.10 (gutsy) Firefox/2.0.0.12 (Linux Mint)) Sender: news X-Virus-Checked: Checked by ClamAV on apache.org Ok, need a little guidance again.. I perform a query which returns some results that I'd like to store in a 2-dimensional array. But when I try running a loop to go through the results, I get a null pointer exception happening. I know that the query is returning 2 rows of results, so why can't I go through them? Here's an example of the kind of thing I'm trying to do... rs = stmt.executeQuery("..."); rs.last(); arr = new String[rs.getRow()][2]; rs.first(); int i; for(i = 0; rs.next(); ++i) { // null pointer exception arr[i][0] = rs.getString("..."); arr[i][1] = rs.getInt("..."); }