Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 95964 invoked from network); 25 Jan 2005 17:04:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur-2.apache.org with SMTP; 25 Jan 2005 17:04:06 -0000 Received: (qmail 82889 invoked by uid 500); 25 Jan 2005 17:03:25 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 82836 invoked by uid 500); 25 Jan 2005 17:03:24 -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: "Derby Development" Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 82806 invoked by uid 99); 25 Jan 2005 17:03:24 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received-SPF: neutral (hermes.apache.org: local policy) Received: from e2.ny.us.ibm.com (HELO e2.ny.us.ibm.com) (32.97.182.142) by apache.org (qpsmtpd/0.28) with ESMTP; Tue, 25 Jan 2005 09:03:22 -0800 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e2.ny.us.ibm.com (8.12.10/8.12.10) with ESMTP id j0PH3KSK031456 for ; Tue, 25 Jan 2005 12:03:20 -0500 Received: from d01av02.pok.ibm.com (d01av02.pok.ibm.com [9.56.224.216]) by d01relay04.pok.ibm.com (8.12.10/NCO/VER6.6) with ESMTP id j0PH3KEr041006 for ; Tue, 25 Jan 2005 12:03:20 -0500 Received: from d01av02.pok.ibm.com (loopback [127.0.0.1]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0PH3Klq027681 for ; Tue, 25 Jan 2005 12:03:20 -0500 Received: from [9.72.133.77] (JACK-IBM-LT1.usca.ibm.com [9.72.133.77]) by d01av02.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j0PH3Jwa027649 for ; Tue, 25 Jan 2005 12:03:19 -0500 Message-ID: <41F67C9B.50302@Mutagen.Net> Date: Tue, 25 Jan 2005 09:06:35 -0800 From: Jack Klebanoff User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.1) Gecko/20040707 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Derby Development Subject: Re: JDBC spec question for ResultSet.updateObject method References: <41F5FFFF.CF202E81@Remulak.Net> In-Reply-To: <41F5FFFF.CF202E81@Remulak.Net> X-Enigmail-Version: 0.85.0.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked X-Spam-Rating: minotaur-2.apache.org 1.6.2 0/1000/N Mamta Satoor wrote: >Hi, > >The JDBC API Tutorial and Reference book says that >"The method setObject (on PreparedStatement) can take a null value only if >the JDBC type is specified". >But I couldn't find anything similar for ResultSet.updateObject(int columnIndex, Object x). >Should this method throw an exception if null is passed for the Object since there is no >way to specify JDBC type for this particular signature of updateObject? > >thanks, >Mamta > > > I suspect that a PreparedStatement may not always be able to decide on the type of a parameter when it compiles a statement, or it may not be able to do so easily. So PreparedStatement.setObject( i, null) may have trouble deciding how to handle the null. However a ResultSet knows the types of all of its columns, so ResultSet.updateObject( i, null) should treat the null as being of the type of the underlying column, which it knows. Jack