Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 27035 invoked from network); 3 Aug 2009 21:51:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 3 Aug 2009 21:51:53 -0000 Received: (qmail 42983 invoked by uid 500); 3 Aug 2009 21:51:57 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 42938 invoked by uid 500); 3 Aug 2009 21:51:57 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 42930 invoked by uid 99); 3 Aug 2009 21:51:57 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 21:51:57 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [63.82.107.6] (HELO red.amberpoint.com) (63.82.107.6) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 03 Aug 2009 21:51:48 +0000 Received: from [127.0.0.1] (bpendleton-desk.edgility.com [10.10.11.118]) by red.amberpoint.com (8.13.8/8.13.8) with ESMTP id n73LpP8N031796 for ; Mon, 3 Aug 2009 14:51:25 -0700 Message-ID: <4A775BDD.4090108@amberpoint.com> Date: Mon, 03 Aug 2009 14:51:25 -0700 From: Bryan Pendleton User-Agent: Thunderbird 2.0.0.22 (Windows/20090605) MIME-Version: 1.0 To: derby-dev@db.apache.org Subject: Re: problem with cast (null as int) References: <316d38e80908021129y3c1d4d8ay8be3b2350f6f5be2@mail.gmail.com> <316d38e80908030912k6b619f52jc8fd88f90f708208@mail.gmail.com> <316d38e80908031210p5a5eee7fx454710714c5c29ac@mail.gmail.com> <316d38e80908031415ibfe81c1j555838eb76edf075@mail.gmail.com> In-Reply-To: <316d38e80908031415ibfe81c1j555838eb76edf075@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org > Exception in thread "main" java.sql.SQLDataException: An attempt was > made to get a data value of type 'INTEGER' from a data value of type 'null'. Hi Eranda, I think this is DERBY-1938 (https://issues.apache.org/jira/browse/DERBY-1938). Do you agree? Can we change your program so that it calls the other version of setObject(), so that we can pass the data type to setObject? That is, I changed your program from for (int i = 1; i <= rsmd.getColumnCount(); i++) { pSt.setObject(i, rs.getObject(i)); } to for (int i = 1; i <= rsmd.getColumnCount(); i++) { pSt.setObject(i, rs.getObject(i), Types.INTEGER); } And then the program does not give the exception. Does this help? thanks, bryan