pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Amit Handa <Amit.Handa@Sun.COM>
To: Kris Jurka <books@ejurka.com>
Cc: Nebojsa Vasiljevic <nebojsa@sw4i.com>
Cc: pgsql-jdbc@postgresql.org
Cc: kmacclay@vantage.com
Cc: bmaguire@vantage.com
Cc: Amit Handa <Amit.Handa@Sun.COM>
Subject: Re: SQLException: Invalid precision value. Cannot be less than
Date: Thu, 10 Feb 2005 15:45:04 +0530
Message-ID: <420B3428.8030309@sun.com> (raw)
In-Reply-To: <Pine.BSO.4.56.0502100304200.6761@leary.csoft.net>
References: <000901c50ef7$b787f9e0$ad00a8c0@mediacenter.org.yu>
	<Pine.BSO.4.56.0502100304200.6761@leary.csoft.net>

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
>
>  
>




view thread (7+ messages)  latest in thread

Message-ID: <420B3428.8030309@sun.com>
Permalink:  ../420B3428.8030309@sun.com/
Also on:    postgresql.org/message-id/420B3428.8030309@sun.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: Amit.Handa@Sun.COM, books@ejurka.com, nebojsa@sw4i.com, kmacclay@vantage.com, bmaguire@vantage.com
  Subject: Re: SQLException: Invalid precision value. Cannot be less than
  In-Reply-To: <420B3428.8030309@sun.com>
  References: <000901c50ef7$b787f9e0$ad00a8c0@mediacenter.org.yu> <Pine.BSO.4.56.0502100304200.6761@leary.csoft.net> <420B3428.8030309@sun.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox