dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] BUG #1628: JDBC bug with regard to text column data type in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Nathan Neuenschwander
 
Posts: n/a

Default [BUGS] BUG #1628: JDBC bug with regard to text column data type - 04-27-2005 , 08:50 AM







The following bug has been logged online:

Bug reference: 1628
Logged by: Nathan Neuenschwander
Email address: nathan_neuenschwander (AT) comcast (DOT) 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.

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply With Quote
  #2  
Old   
Oliver Jowett
 
Posts: n/a

Default Re: [BUGS] BUG #1628: JDBC bug with regard to text column data type - 04-27-2005 , 06:36 PM






Nathan Neuenschwander wrote:

Quote:
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

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo (AT) postgresql (DOT) org)


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.