Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 65348 invoked from network); 14 Oct 2005 00:36:36 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Oct 2005 00:36:36 -0000 Received: (qmail 78207 invoked by uid 500); 14 Oct 2005 00:36:36 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 77963 invoked by uid 500); 14 Oct 2005 00:36:34 -0000 Mailing-List: contact derby-dev-help@db.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list derby-dev@db.apache.org Received: (qmail 77951 invoked by uid 99); 14 Oct 2005 00:36:34 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2005 17:36:34 -0700 X-ASF-Spam-Status: No, hits=2.8 required=10.0 tests=DNS_FROM_RFC_ABUSE,DNS_FROM_RFC_POST,DNS_FROM_RFC_WHOIS X-Spam-Check-By: apache.org Received-SPF: neutral (asf.osuosl.org: local policy) Received: from [32.97.182.144] (HELO e4.ny.us.ibm.com) (32.97.182.144) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 13 Oct 2005 17:36:35 -0700 Received: from d01relay04.pok.ibm.com (d01relay04.pok.ibm.com [9.56.227.236]) by e4.ny.us.ibm.com (8.12.11/8.12.11) with ESMTP id j9E0aBT3016527 for ; Thu, 13 Oct 2005 20:36:11 -0400 Received: from d01av01.pok.ibm.com (d01av01.pok.ibm.com [9.56.224.215]) by d01relay04.pok.ibm.com (8.12.10/NCO/VERS6.7) with ESMTP id j9E0aBFx081748 for ; Thu, 13 Oct 2005 20:36:11 -0400 Received: from d01av01.pok.ibm.com (loopback [127.0.0.1]) by d01av01.pok.ibm.com (8.12.11/8.13.3) with ESMTP id j9E0aAbp025992 for ; Thu, 13 Oct 2005 20:36:11 -0400 Received: from [127.0.0.1] (svl-arbrown.svl.ibm.com [9.30.40.140]) by d01av01.pok.ibm.com (8.12.11/8.12.11) with ESMTP id j9E0a8S7025762 for ; Thu, 13 Oct 2005 20:36:10 -0400 Message-ID: <434EFD77.2040303@sbcglobal.net> Date: Thu, 13 Oct 2005 17:36:07 -0700 From: Army 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: setNull() using Types.VARCHAR for a CLOB parameter fails in embedded mode. Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N If I attempt to call PreparedStatement.setNull() and specify Types.VARCHAR when the actual parameter type (as determined at bind time) is CLOB, Derby in embedded mode will throw an error, while Derby in client/server mode will succeed. Ex. running the following code: st.execute("create table t1 (c clob)"); PreparedStatement pSt = conn.prepareStatement( "insert into t1 values (?)"); try { pSt.setNull(1, Types.VARCHAR); pSt.execute(); System.out.println("Error did NOT reproduce."); } catch (SQLException se) { System.out.println("Error reproduced:"); se.printStackTrace(); } Against Derby embedded, the result will be: Error reproduced: SQL Exception: An attempt was made to get a data value of type 'CLOB' from a data value of type 'VARCHAR'. But against the Network Server, everything works fine. Derby embedded will work in other cases where compatible types are used (ex. using setNull() with Types.INTEGER for a BIGINT parameter), but fails for this particular situation. Thus I'm assuming this is _not_ intentional (i.e. that the above code should work). Can anyone confirm one way or the other? If I don't hear otherwise, I'll file a Jira issue tomorrow. Thanks, Army