Return-Path: Delivered-To: apmail-db-derby-user-archive@www.apache.org Received: (qmail 53437 invoked from network); 14 Jun 2006 22:39:21 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 14 Jun 2006 22:39:21 -0000 Received: (qmail 62425 invoked by uid 500); 14 Jun 2006 22:39:14 -0000 Delivered-To: apmail-db-derby-user-archive@db.apache.org Received: (qmail 62386 invoked by uid 500); 14 Jun 2006 22:39:14 -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 62371 invoked by uid 99); 14 Jun 2006 22:39:14 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 15:39:14 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=RCVD_IN_BL_SPAMCOP_NET,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: domain of tomdzk@gmail.com designates 66.249.92.168 as permitted sender) Received: from [66.249.92.168] (HELO ug-out-1314.google.com) (66.249.92.168) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 14 Jun 2006 15:39:13 -0700 Received: by ug-out-1314.google.com with SMTP id m3so612123uge for ; Wed, 14 Jun 2006 15:38:51 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=sxGKIWYT5/KTBcOqPRBRaDpWa/SXhVzV62RVvHV6NGxJpfAoeryRJnsq8vRvrCxzcR3dXOARGeqIRLXdT0zgvWnfwOulwsW7EQQIBygqoN06p+JxNM1eeqj3+Ml/YlJryzVYTdB7etsPk3Ak4Bidw59TC1hC8iUQ8TeE9HcY7AY= Received: by 10.66.216.20 with SMTP id o20mr1128468ugg; Wed, 14 Jun 2006 15:38:51 -0700 (PDT) Received: by 10.67.95.19 with HTTP; Wed, 14 Jun 2006 15:38:51 -0700 (PDT) Message-ID: <224f32340606141538o1605a6efs81fb252f3789d915@mail.gmail.com> Date: Thu, 15 Jun 2006 00:38:51 +0200 From: "Thomas Dudziak" To: "Derby Discussion" Subject: Re: The tutorial on migrating DB to derby In-Reply-To: <44907096.4010402@sbcglobal.net> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <42120.205.175.225.24.1150307715.squirrel@mail.eng.iastate.edu> <449050F0.70206@bristowhill.com> <44907096.4010402@sbcglobal.net> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N On 6/14/06, Kathey Marsden wrote: > Caused by: SQL Exception: Zero or negative length argument '0' passed in > a BLOB or CLOB method. > at > org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:80) > at > org.apache.derby.impl.jdbc.Util.newEmbedSQLException(Util.java:87) > at > org.apache.derby.impl.jdbc.Util.generateCsSQLException(Util.java:166) > at > org.apache.derby.impl.jdbc.EmbedClob.getSubString(EmbedClob.java:206) > at > org.apache.ddlutils.platform.PlatformImplBase.extractColumnValue(PlatformImplBase.java:1961) Well, I haven't done much with Clobs lately, but the code in question Clob clob = resultSet.getClob(columnName); if ((clob == null) || (clob.length() > Integer.MAX_VALUE)) { value = clob; } else { value = clob.getSubString(1l, (int)clob.length()); } seems to be ok according to the Clob javadocs (http://java.sun.com/j2se/1.4.2/docs/api/java/sql/Clob.html#getSubString(long,%20int)), right ? A string is only returned (and getSubString called) if the length of the clob is within int range, so length() seems to return a value <= 0 ? Tom