pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedSQLException: Cannot be less than zero
2+ messages / 2 participants
[nested] [flat]
* SQLException: Cannot be less than zero
@ 2005-07-13 17:22 xavier.marquis@cegetel.net
2005-07-13 17:27 ` Re: SQLException: Cannot be less than zero Kris Jurka <books@ejurka.com>
0 siblings, 1 reply; 2+ messages in thread
From: xavier.marquis@cegetel.net @ 2005-07-13 17:22 UTC (permalink / raw)
To: pgsql-jdbc
Hi,
I use PostgreSQL 8.0.3 and following associated drivers :
postgresql-8.0-311.jdbc2.jar
postgresql-8.0-311.jdbc2ee.jar
postgresql-8.0-311.jdbc3.jar
I want to use CachedRowSetImpl to populate one row in the following table :
CREATE TABLE "Form2"
(
form2member3 int4,
form2member5 int8[],
)
WITHOUT OIDS;
The second column (an array of bigint) seems to cause the following
exception when try to populate :
java.sql.SQLException: Invalid column display size. Cannot be less than zero
at javax.sql.rowset.RowSetMetaDataImpl.setColumnDisplaySize(RowSetMetaDataImpl.java:267)
at com.sun.rowset.CachedRowSetImpl.initMetaData(CachedRowSetImpl.java:679)
at com.sun.rowset.CachedRowSetImpl.populate(CachedRowSetImpl.java:597)
at com.sun.rowset.internal.CachedRowSetReader.readData(CachedRowSetReader.java:170)
at com.sun.rowset.CachedRowSetImpl.execute(CachedRowSetImpl.java:736)
at ...
at MainTester.main(MainTester.java:41)
After reading the only few related subjects, I can't find any
solution that I be able to use.
(Nebojsa Vasiljevic made a patch but didn't say how to do it ...)
Has someone yet met and solved this unexpected problem (even momently) ?
Otherwise, Is there another way to deal with variable-length lists ?
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: SQLException: Cannot be less than zero
2005-07-13 17:22 SQLException: Cannot be less than zero xavier.marquis@cegetel.net
@ 2005-07-13 17:27 ` Kris Jurka <books@ejurka.com>
0 siblings, 0 replies; 2+ messages in thread
From: Kris Jurka @ 2005-07-13 17:27 UTC (permalink / raw)
To: xavier.marquis@cegetel.net; +Cc: pgsql-jdbc
On Wed, 13 Jul 2005 xavier.marquis@cegetel.net wrote:
> I use PostgreSQL 8.0.3 and I want to use CachedRowSetImpl to populate
> one row in the following table :
>
> CREATE TABLE "Form2"
> (
> form2member3 int4,
> form2member5 int8[],
> )
>
> The second column (an array of bigint) seems to cause the following
> exception when try to populate :
>
> java.sql.SQLException: Invalid column display size. Cannot be less than zero
> at javax.sql.rowset.RowSetMetaDataImpl.setColumnDisplaySize(RowSetMetaDataImpl.java:267)
>
> Has someone yet met and solved this unexpected problem (even momently) ?
> Otherwise, Is there another way to deal with variable-length lists ?
This is a known problem with any variable length data. The postgresql
JDBC driver returns -1 to indicate that the display size is unknown which
the RowSet implementation doesn't seem to like. People have modified the
driver to return 0 in this situation and that allows the rowset to work,
but I don't think it's the right thing to do. In the past someone from
Sun said they'd look into what we should be doing but they never got back
to us.
Kris Jurka
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2005-07-13 17:27 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-07-13 17:22 SQLException: Cannot be less than zero xavier.marquis@cegetel.net
2005-07-13 17:27 ` Kris Jurka <books@ejurka.com>
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