Return-Path: Delivered-To: apmail-db-derby-dev-archive@www.apache.org Received: (qmail 98413 invoked from network); 14 Jul 2006 20:31:47 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jul 2006 20:31:47 -0000 Received: (qmail 8461 invoked by uid 500); 14 Jul 2006 20:31:46 -0000 Delivered-To: apmail-db-derby-dev-archive@db.apache.org Received: (qmail 8432 invoked by uid 500); 14 Jul 2006 20:31:46 -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 8416 invoked by uid 99); 14 Jul 2006 20:31:46 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 13:31:46 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_MESSAGE,UNPARSEABLE_RELAY X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [192.18.98.36] (HELO brmea-mail-4.sun.com) (192.18.98.36) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 14 Jul 2006 13:31:44 -0700 Received: from fe-amer-05.sun.com ([192.18.108.179]) by brmea-mail-4.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k6EKVNUn009794 for ; Fri, 14 Jul 2006 14:31:24 -0600 (MDT) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) id <0J2E00K01TWNZE00@mail-amer.sun.com> (original mail from Lance.Andersen@Sun.COM) for derby-dev@db.apache.org; Fri, 14 Jul 2006 14:31:23 -0600 (MDT) Received: from [129.150.65.237] by mail-amer.sun.com (Sun Java System Messaging Server 6.2-4.02 (built Sep 9 2005)) with ESMTPSA id <0J2E00AY5UCAVTX4@mail-amer.sun.com> for derby-dev@db.apache.org; Fri, 14 Jul 2006 14:31:23 -0600 (MDT) Date: Fri, 14 Jul 2006 16:31:23 -0400 From: "Lance J. Andersen" Subject: Re: [jira] Commented: (DERBY-1501) PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL Exception if given sqlType is LONGVARBINARY in embedded mode In-reply-to: <18921303.1152712112909.JavaMail.jira@brutus> Sender: Lance.Andersen@Sun.COM To: derby-dev@db.apache.org Message-id: <44B7FF1B.5060309@sun.com> MIME-version: 1.0 Content-type: multipart/alternative; boundary="Boundary_(ID_4RWzfq0ed7xw5qBo/TZIQg)" References: <18921303.1152712112909.JavaMail.jira@brutus> User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. --Boundary_(ID_4RWzfq0ed7xw5qBo/TZIQg) Content-type: text/plain; format=flowed; charset=UTF-8 Content-transfer-encoding: 7BIT i have removed the rogue sentence in its entirety from the javadocs for setNull(int,int, String) as it is not needed and is not correct in regards to typeCode. -lance Daniel John Debrunner (JIRA) wrote: > [ http://issues.apache.org/jira/browse/DERBY-1501?page=comments#action_12420620 ] > > Daniel John Debrunner commented on DERBY-1501: > ---------------------------------------------- > > Knut Anders indicates > > setNull(int,int,String) > - If a JDBC driver does not need the type code or type name > information, it may ignore it. > setNull(int,int) > You must specify the parameter's SQL type. > > Interesting, here the issue is about setNull(int,int) which doesn't have that comment about ignoring typeCode. > Could the omission be intentional and the wording in setNull(int,int,String) meant to be clearer, so that > one of typeCode or typeName could be ignored, but not both? > > With setNull(1, Types.LONGVARBINARY) it is saying send a NULL of LONGVARBINARY to the engine, > the engine should then treat it the same as a cast of a LONGVARCHAR FOR BIT DATA to the target type. > > > > > >> PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL Exception if given sqlType is LONGVARBINARY in embedded mode >> ---------------------------------------------------------------------------------------------------------------------------------- >> >> Key: DERBY-1501 >> URL: http://issues.apache.org/jira/browse/DERBY-1501 >> Project: Derby >> Type: Bug >> > > >> Versions: 10.1.1.0 >> Environment: WindowsXP >> Reporter: Markus Fuchs >> Attachments: ByteArrayTest.java >> >> When inserting a row into following table >> BYTEARRAY_TEST( ID int, BYTEARRAY_VAL blob) >> PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL Exception if given sqlType is LONGVARBINARY. You must give sqlType BLOB to make the insert work. The same test works using sqlType LONGVARBINARY in network mode. The following combinations don't work: >> Column type sqlType not working mandatory sqlType >> BLOB LONGVARBINARY BLOB >> CLOB LONGVARCHAR CLOB >> The issue here is that first Derby behaves differently in network and embedded mode. And secondly, should accept LONGVARBINARY/LONGVARCHAR for BLOB/CLOB columns. >> > > --Boundary_(ID_4RWzfq0ed7xw5qBo/TZIQg) Content-type: text/html; charset=UTF-8 Content-transfer-encoding: 7BIT i have removed the rogue sentence in its entirety from the javadocs for setNull(int,int, String) as it is not needed and is not correct in regards to typeCode.

-lance

Daniel John Debrunner (JIRA) wrote:
    [ http://issues.apache.org/jira/browse/DERBY-1501?page=comments#action_12420620 ] 

Daniel John Debrunner commented on DERBY-1501:
----------------------------------------------

Knut Anders indicates

setNull(int,int,String)
 - If a JDBC driver does not need the type code or type name
  information, it may ignore it. 
setNull(int,int)
    You must specify the parameter's SQL type.

Interesting, here the issue is about setNull(int,int) which doesn't have that comment about ignoring typeCode.
Could the omission be intentional and the wording in setNull(int,int,String) meant to be clearer, so that
one of typeCode or typeName could be ignored, but not both?

With setNull(1, Types.LONGVARBINARY) it is saying send a NULL of LONGVARBINARY to the engine,
the engine should then treat it the same as a cast of a LONGVARCHAR FOR BIT DATA to the target type.




  
PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL Exception if given sqlType is LONGVARBINARY in embedded mode
----------------------------------------------------------------------------------------------------------------------------------

         Key: DERBY-1501
         URL: http://issues.apache.org/jira/browse/DERBY-1501
     Project: Derby
        Type: Bug
    

  
    Versions: 10.1.1.0
 Environment: WindowsXP
    Reporter: Markus Fuchs
 Attachments: ByteArrayTest.java

When inserting a row into following table
BYTEARRAY_TEST( ID int, BYTEARRAY_VAL blob)
PreparedStatement#setNull(int parameterIndex, int sqlType) throws SQL Exception if given sqlType is LONGVARBINARY. You must give sqlType BLOB to make the insert work. The same test works using sqlType LONGVARBINARY in network mode. The following combinations don't work:
Column type               sqlType not working             mandatory sqlType
BLOB                           LONGVARBINARY                 BLOB
CLOB                           LONGVARCHAR                    CLOB
The issue here is that first Derby behaves differently in network and embedded mode. And secondly, should accept LONGVARBINARY/LONGVARCHAR for BLOB/CLOB columns.
    

  
--Boundary_(ID_4RWzfq0ed7xw5qBo/TZIQg)--