Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?

From: DGPickett <DGPickett(at)aol(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
Date: 2009-03-02 16:25:53
Message-ID: 5689f05b-134f-4510-af43-6fe763dfceb4@y13g2000yqn.googlegroups.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Mar 2, 4:10 am, oli(dot)(dot)(dot)(at)opencloud(dot)com (Oliver Jowett) wrote:
> Or you could change the calling code to
> bounds-check the metadata results before it goes off and tries to
> allocate the entire heap for one column in one row ..

If you have to change calling code to access Postgres, it violates the
original promise of JDBC: use me and be portable. If you want an 'I
don't know' response built into this API method, sell it to the JDBC
community, but until then, it is a requirement. Most RDBMS have not
stumbled when delivering on the requirement, so selling it as a
hardship seems difficult. As the real estate zoning lawyers say,
"This is, at best, a self-imposed hardship."

Re: Character / Byte, I know that in addition to 1, 2 and 4 byte wide
characters of several families, we have these variable width creatures
like UTF-8. RDBMS developers can hardly be happy about complications
of this development, but to stay on the road to being more and more
application-facing, they should provide storage in characters for any
sort of character, even if the underlying storage must be overly
generous or variable to accommodate this. JAVA and JDBC are just
leading the way. When this call is made, they should be able to say
how many characters are configured for the result set column. Just as
when smallint + int is typed up to int (bigint would be safer) to hold
the result and all the smallint values are cast up, when "X" || zzz (a
column varchar(10)) is parsed, the result should be typed varchar(11)
or char(11). The RDBMS should provide this metadata from its parsing
process to JDBC.

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message Hannu Krosing 2009-03-02 22:17:28 Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
Previous Message Stanley Wong 2009-03-02 15:05:33 Cannot create JDBC driver of class '' for connect URL 'null'