From: Kris Jurka <books@ejurka.com>
To: pedro farinha <op217537@mail.telepac.pt>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Again the JSCreator and Metadata issues
Date: Fri, 18 Nov 2005 13:41:01 -0500 (EST)
Message-ID: <Pine.BSO.4.61.0511181331280.1663@leary.csoft.net> (raw)
In-Reply-To: <1132193745.6622.9.camel@localhost.localdomain>
References: <1132193745.6622.9.camel@localhost.localdomain>
On Thu, 17 Nov 2005, pedro farinha wrote:
> I am testing the new JSC2 early access and I come across a old
> problem....getResultMetaData null values (I think). In JSC 1 the driver
> works fine but on this early access version it doesn't. I am posting
> what I think is relevant of the trace. I am not sure if this is a issue
> with the driver or the JSC it self so I am posting this into here as
> well as into the EAfeedback program.
>
> java.lang.RuntimeException: java.sql.SQLException: Invalid column
> display size. Cannot be less than zero
> at
> com.sun.data.provider.impl.CachedRowSetDataProvider.getMetaData(CachedRowSetDataProvider.java:1299)
I believe you have a variable length field in your table. Sun's
CachedRowSet implementation examines the ResultSetMetaData and creates its
own copy of it. The postgresql JDBC driver returns -1 for
ResultSetMetaData.getColumnDisplaySize() meaning unknown for variable
length fields, like say a column of type "text". Sun does not like this
value and reports an error. In the past we've tried to ask Sun for some
advice in this area and got nothing in response. Other than -1 the
only other real defensible value for getColumnDisplaySize would
probably be Integer.MAX_VALUE. We've been concerned that GUIs would
try to actually use this provided value and they would blow up, but
the only complaints we've heard are from people disliking the -1
value and this problem doesn't seem to be going away.
I suggest we try returning Integer.MAX_VALUE for a while and see what
complaints we get. Objections?
Kris Jurka
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: books@ejurka.com, op217537@mail.telepac.pt
Subject: Re: Again the JSCreator and Metadata issues
In-Reply-To: <Pine.BSO.4.61.0511181331280.1663@leary.csoft.net>
References: <1132193745.6622.9.camel@localhost.localdomain> <Pine.BSO.4.61.0511181331280.1663@leary.csoft.net>
* 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