Обсуждение: BUG #1628: JDBC bug with regard to text column data type

Поиск
Список
Период
Сортировка

BUG #1628: JDBC bug with regard to text column data type

От
"Nathan Neuenschwander"
Дата:
The following bug has been logged online:

Bug reference:      1628
Logged by:          Nathan Neuenschwander
Email address:      nathan_neuenschwander@comcast.net
PostgreSQL version: 8.0
Operating system:   Win XP
Description:        JDBC bug with regard to text column data type
Details:

I am using a CachedRowSet, the JDBC driver for PG 8.0, and j2ee.
If the target table contains a column of data type text, the following
causes an SQLException with a message stating that a negative value was
returned for the column display size. If the text column is changed to a
varchar, the exception is not triggered. The exception is not dependent upon
the particular column being queried, just the enclosing table. (The proper
variable init is implied.)

SQL
# Create column with text data type.
Create Table table_a(field1 Integer, field2 text);

// Java
cachedrowset.setCommand("Select field2 from table_a");
cachedrowset.execute(connection); // Results in Exception.

SQL
# Create column with varchar data type.
Create Table table_b(field1 Integer, field2 varchar(100));

// Java
cachedrowset.setCommand("Select field2 from table_b");
cachedrowset.execute(connection); // No Exception.

Re: BUG #1628: JDBC bug with regard to text column data type

От
Oliver Jowett
Дата:
Nathan Neuenschwander wrote:

> I am using a CachedRowSet, the JDBC driver for PG 8.0, and j2ee.
> If the target table contains a column of data type text, the following
> causes an SQLException with a message stating that a negative value was
> returned for the column display size. If the text column is changed to a
> varchar, the exception is not triggered. The exception is not dependent upon
> the particular column being queried, just the enclosing table. (The proper
> variable init is implied.)

I believe we are still waiting for Sun to get back to us on this (it's
arguable whether the bug lies in the JDBC driver or in what their RowSet
implementation is expecting). Search the pgsql-jdbc archives for details.

-O