Re: SQLException: Invalid precision value. Cannot be less than zero

From: "Nebojsa Vasiljevic" <nebojsa(at)sw4i(dot)com>
To: "Kris Jurka" <books(at)ejurka(dot)com>
Cc: <pgsql-jdbc(at)postgresql(dot)org>, <amit(dot)handa(at)sun(dot)com>, <kmacclay(at)vantage(dot)com>, <bmaguire(at)vantage(dot)com>
Subject: Re: SQLException: Invalid precision value. Cannot be less than zero
Date: 2005-02-10 09:50:25
Message-ID: 002801c50f55$f25a2d00$ad00a8c0@mediacenter.org.yu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc


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

javax.sql.rowset.RowSetMetaDataImpl class is part of Sun JDK 1.5.
I don't like Sun forces nonegative values in
javax.sql.rowset.RowSetMetaDataImpl,
but we can't change it. Sun will not change the JDK to make PosgreSQL driver
work.

Don't wait for Sun's suggestion, just look how other drivers works.

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

"create table nt (a numeric(0,0))" is as illegal as "create table nt (a
numeric(-1,-1))".
Precision 0 stands for "create table nt (a numeric)".

Nebojsa

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Amit Handa 2005-02-10 10:15:04 Re: SQLException: Invalid precision value. Cannot be less than
Previous Message NielsG 2005-02-10 09:44:59 Possible Bug with JDBC 8.0-310 JDBC 3