Thread: pgsql jdbc setObject JAVA_OBJECT error

pgsql jdbc setObject JAVA_OBJECT error

From
tyju tiui
Date:
Hi,

I'm trying to use the 'setObject' method of a preparedStatement to store a POJO and I'm getting an error:
    org.postgresql.util.PSQLException: Unsupported Types value: 2,000

I'm using build 8.2 Build 507 of the jdbc driver with PostgreSQL 8.2.5 on a Debian Etch server with Java 1.6.
Here's the snippet which throws the error above:
    pstatement.setObject(1, myPojoInst, java.sql.Types.JAVA_OBJECT);

Any idea what I'm doing wrong?

Thanks,

Ty


Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.

Re: pgsql jdbc setObject JAVA_OBJECT error

From
Kris Jurka
Date:

On Tue, 18 Dec 2007, tyju tiui wrote:

> I'm trying to use the 'setObject' method of a preparedStatement to store
> a POJO and I'm getting an error:
>    org.postgresql.util.PSQLException: Unsupported Types value: 2,000
>

The postgresql JDBC driver currently does not support storing Java objects
directly like this.  Perhaps you could serialize them yourself and store
them in a bytea field?

Kris Jurka