Re: ResultSetMetaData + CachedResultSet bug

From: Kris Jurka <books(at)ejurka(dot)com>
To: Thomas Hallgren <thomas(at)tada(dot)se>
Cc: Postgres-JDBC <pgsql-jdbc(at)postgresql(dot)org>
Subject: Re: ResultSetMetaData + CachedResultSet bug
Date: 2006-11-03 07:22:44
Message-ID: Pine.BSO.4.63.0611030220200.6037@leary2.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Fri, 30 Jun 2006, Thomas Hallgren wrote:

> Kris Jurka wrote:
>>
>> [what to do about precision for non-numeric types]
>>
> I think the current -1 is reasonable for non numeric types. For the numeric
> types however, the interpretation should be that 0 is unlimited. A numeric
> should never return -1 and should accept setPrecision(colidx, 0) as 'no
> limit', i.e.
>
> 0 = unlimited
> -1 = not applicable
>
> The rationale is that a) stating that a varchar has zero decimal digits is
> wrong since it doesn't have any notion of decimal digits, and b) a precision
> of zero for a numeric doesn't make sense when interpreted verbatim.
>

The latest javadocs have clarified what they expect precision to mean for
non-numeric datatypes.

http://download.java.net/jdk6/docs/api/java/sql/ResultSetMetaData.html#getPrecision(int)

I've adjusted the driver to follow the new rules and not return -1
anymore.

Kris Jurka

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Stefano B. 2006-11-03 07:52:22 Re: JTable and ResultSet TableModel with big resultset
Previous Message Kris Jurka 2006-11-03 04:50:54 Re: Bug with callable statement and output parameters