Setting array values in JDBC (Driver 7.2) - Mailing list pgsql-jdbc

From Doug Fields
Subject Setting array values in JDBC (Driver 7.2)
Date
Msg-id 5.1.0.14.2.20020220190127.035013a8@mail.pexicom.com
Whole thread Raw
List pgsql-jdbc
Hello,

As Barry has said, setArray() on a Prepared Statement is currently implemented.

However, there seems to be no way to actually update a Postgresql row with
a native Java array.

Per the JDBC Docs, one should be able to do this with the setObject() call.
This doesn't work in PG JDBC:

DbArrayTest.doInsertTest: SQLException: The table for [I is not in the
database. Contact the DBA, as the database is in an inconsistent state.

(when using an int[] array)

So, you can setArray() but there is no way to create an Array object except
by using the getArray() from retrieving a ResultSet. Well, if you're
creating a record from scratch, you seem to be stuck.

Help?

Thanks,

Doug


pgsql-jdbc by date:

Previous
From: Doug Fields
Date:
Subject: Empty arrays cause SQLExceptions when using Array.getArray
Next
From: "Dave Cramer"
Date:
Subject: Re: Problem with Date and UpdatableResultSet.java??