Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ? - Mailing list pgsql-jdbc

From Kris Jurka
Subject Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
Date
Msg-id Pine.BSO.4.64.0902261310090.24291@leary.csoft.net
Whole thread Raw
In response to Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?  (DGPickett <DGPickett@aol.com>)
List pgsql-jdbc

On Thu, 26 Feb 2009, DGPickett wrote:

> I feel it runs contrary to the purpose of JDBC to make clients have
> postgres-specific code for this response.  The common JDBC
> speccification does not support returning int max (or anything else)
> for "I don't know."

Exactly.  Since the spec doesn't say what to do, what do you want the JDBC
driver to do?  Throw an exception?  That's not helpful at all.  The JDBC
team has come up with a solution that works for most clients.  If you have
a concrete suggestion as to how this case should be handled that will work
for everyone, then we'd be glad to hear it.  Just wishing this case didn't
exist isn't helpful.

> It seems unreasonable that this implementation cannot deal with these
> trivial cases.  I am not sure whether the fault lies with the JDBC
> implementation or the underlying RDBMS server, that we cannot
> determine that "X" is 1 byte wide...

The server is responsible for determining the type and length of data, not
the JDBC driver.  The server tells the JDBC driver that it is unknown and
the driver has to do something with it.  You are still ignoring the fact
that there must be cases where the server cannot possibly know the length
of a piece of data even if it was capable of of handling the simpler
cases.

Kris Jurka

pgsql-jdbc by date:

Previous
From: DGPickett
Date:
Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?
Next
From: DGPickett
Date:
Subject: Re: ResultSetMetaData.getColumnDisplaySize returns 2147483647 ?