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 CE6758B9C04 for ; Thu, 10 Feb 2005 10:49:45 +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 45832-01 for ; Thu, 10 Feb 2005 10:49:36 +0000 (GMT) Received: from mail.b92.net (free.b92.net [212.102.128.4]) by svr1.postgresql.org (Postfix) with ESMTP id E26BA8B9B6F for ; Thu, 10 Feb 2005 10:49:36 +0000 (GMT) Received: (qmail 1019 invoked from network); 10 Feb 2005 10:49:36 -0000 Received: from nbg-i73.dial.b92.net (HELO nebojsa) (212.102.134.206) by mail.b92.net with SMTP; 10 Feb 2005 10:49:36 -0000 Message-ID: <006a01c50f5e$35f57b70$ad00a8c0@mediacenter.org.yu> From: "Nebojsa Vasiljevic" To: "Amit Handa" , "Kris Jurka" Cc: , , , "Amit Handa" References: <000901c50ef7$b787f9e0$ad00a8c0@mediacenter.org.yu> <420B3428.8030309@sun.com> Subject: Re: SQLException: Invalid precision value. Cannot be less than zero Date: Thu, 10 Feb 2005 11:49:34 +0100 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=response Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2900.2180 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 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/57 X-Sequence-Number: 12237 > 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 ? Method javax.sql.rowset.RowSetMetaDataImpl.setColumnDisplaySize() throws exception after it is called from: com.sun.rowset.CachedRowSetImpl.initMetaData(CachedRowSetImpl.java:679) If you catch exception in CachedRowSetImpl.java, you have to decide what value to put in columnDisplaySize property. Possible answer is: If columnDisplaySize, precision or scale property of ResultSetMetaData is -1 then appropriate property of RowSetMetaDataImpl will be 0. (and you don't need try/catcher to do that) If various JDBC drivers use -1, this may be reasonable solution. Nebojsa