X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id B0DC08B9CC7 for ; Thu, 10 Feb 2005 10:16:47 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 42214-07 for ; Thu, 10 Feb 2005 10:16:30 +0000 (GMT) Received: from brmea-mail-3.sun.com (brmea-mail-3.Sun.COM [192.18.98.34]) by svr1.postgresql.org (Postfix) with ESMTP id AAE158B9B86 for ; Thu, 10 Feb 2005 10:16:31 +0000 (GMT) Received: from phys-biff-1 ([129.158.227.36]) by brmea-mail-3.sun.com (8.12.10/8.12.9) with ESMTP id j1AAGSOL013677 for ; Thu, 10 Feb 2005 03:16:31 -0700 (MST) Received: from conversion-daemon.biff-mail1.india.sun.com by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) id <0IBO00501XSM7J@biff-mail1.india.sun.com> (original mail from Amit.Handa@Sun.COM) for pgsql-jdbc@postgresql.org; Thu, 10 Feb 2005 15:46:28 +0530 (IST) Received: from [129.158.229.190] (javasoft18.India.Sun.COM [129.158.229.190]) by biff-mail1.india.sun.com (iPlanet Messaging Server 5.2 HotFix 1.24 (built Dec 19 2003)) with ESMTP id <0IBO009TVXVF1V@biff-mail1.india.sun.com>; Thu, 10 Feb 2005 15:46:28 +0530 (IST) Date: Thu, 10 Feb 2005 15:45:04 +0530 From: Amit Handa Subject: Re: SQLException: Invalid precision value. Cannot be less than In-reply-to: To: Kris Jurka Cc: Nebojsa Vasiljevic , pgsql-jdbc@postgresql.org, kmacclay@vantage.com, bmaguire@vantage.com, Amit Handa Message-id: <420B3428.8030309@sun.com> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7BIT X-Accept-Language: en-us, en User-Agent: Mozilla Thunderbird 1.0 (X11/20041208) References: <000901c50ef7$b787f9e0$ad00a8c0@mediacenter.org.yu> X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200502/60 X-Sequence-Number: 12240 That's right we *can't change the spec*. But hold on guys, I can put a try catch block for this and prevent the SQLException from being thrown in the implementation, wherever it is being called in from *other classes*. And hence we can go on. But yes I can't change the spec class from doing that. It's(return -1 for variable length data) is used by various JDBC drivers that way. Does that help ? Also, Can you give me the stack trace of the exception ? I just want to confirm the try catch block I put is at the right place (i.e. exception will be caught in CachedRowSetImpl.java), and works with you guys. Further I am going to file a bug with our bug tracking system and get some feedback internally, so that I keep things black and white. You can view it over the web later as well. thanks, Amit Handa, Sun Microsystems Inc. PS: Kevin seems to have vanished ;) I was trying to help him with this and some other problems but never heard back, though I am also slow at times to get back to him because of other commitments. Kris Jurka wrote: >On Wed, 9 Feb 2005, Nebojsa Vasiljevic wrote: > > > >>[CachedRowSet doesn't like -1 precision values for numeric] >> >> > >This has been discussed, partially offlist, with Sun in the context of >getColumnDisplaySize returning -1 for text and varchar with no length >attribute fields. I've been waiting for a suggestion from Sun on what >value to use, or if they will alter their code to remove this check. > >Your suggestion of using 0 passes their check, but still isn't legal: > >jurka=# create table nt (a numeric(0,0)); >ERROR: NUMERIC precision 0 must be between 1 and 1000 > >The -1 value is intended to indicate we don't know or unlimited or >similar and I don't particularly like it, but I've yet to hear a better >suggestion. > >Kris Jurka > > >