pg.ddx.io pgsql-jdbc@postgresql.org mailing list archive
help / color / mirror / Atom feedStatement setNull for Types.CLOB
3+ messages / 3 participants
[nested] [flat]
* Statement setNull for Types.CLOB
@ 2005-02-18 17:41 Matt Magoffin <postgresql.org@msqr.us>
0 siblings, 1 reply; 3+ messages in thread
From: Matt Magoffin @ 2005-02-18 17:41 UTC (permalink / raw)
To: pgsql-jdbc
Hello, I'm using PostgreSQL 8 and the 310 build of the 8.0 JDBC3 driver
with Hibernate. For 'text' columns in my database, I had mapped them to
the Hibernate "text" type. When attempting to set the value of a text
column to 'null' via a PreparedStatement Hibernate calls setNull() passing
the Types.CLOB as the SQL type. The Postgres driver is throwing an
exception, however, saying that type is unknown.
I can easily change the Hibernate mapping to "string", which would change
the SQL type passed to setNull() to Types.VARCHAR, but I was wondering if
Types.CLOB should be a supported value in the setNull() JDBC method?
I realize it might not be correct to think of the PostgreSQL text type as
a CLOB, so I just wanted some insight on this issue if possible.
Thanks,
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Statement setNull for Types.CLOB
@ 2005-02-18 20:10 Kris Jurka <books@ejurka.com>
parent: Matt Magoffin <postgresql.org@msqr.us>
0 siblings, 0 replies; 3+ messages in thread
From: Kris Jurka @ 2005-02-18 20:10 UTC (permalink / raw)
To: Matt Magoffin <postgresql.org@msqr.us>; +Cc: pgsql-jdbc
On Fri, 18 Feb 2005, Matt Magoffin wrote:
> Hello, I'm using PostgreSQL 8 and the 310 build of the 8.0 JDBC3 driver
> with Hibernate. For 'text' columns in my database, I had mapped them to
> the Hibernate "text" type. When attempting to set the value of a text
> column to 'null' via a PreparedStatement Hibernate calls setNull() passing
> the Types.CLOB as the SQL type. The Postgres driver is throwing an
> exception, however, saying that type is unknown.
>
This problem was just reported for bytea/BLOB here:
http://archives.postgresql.org/pgsql-jdbc/2005-02/msg00115.php
The same situation applies, I've fixed the setNull call to do something,
but again CLOB really maps to the oid datatype in pg, not text.
Kris Jurka
^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Statement setNull for Types.CLOB
@ 2005-06-24 21:18 Kevin Murphy <murphy@genome.chop.edu>
0 siblings, 0 replies; 3+ messages in thread
From: Kevin Murphy @ 2005-06-24 21:18 UTC (permalink / raw)
To: pgsql-jdbc
On Fri, 18 Feb 2005, Kris Jurka wrote:
> On Fri, 18 Feb 2005, Matt Magoffin wrote:
>> Hibernate calls setNull() passing
>> the Types.CLOB as the SQL type. The Postgres driver is throwing an
>> exception, however, saying that type is unknown.
>
> I've fixed the setNull call to do something,
> but again CLOB really maps to the oid datatype in pg, not text.
I just encountered the same problem with setObject in
postgresql-8.0-311.jdbc3.jar, btw.
I don't understand the bit about oid, so I guess I will use
Types.VARCHAR unless instructed otherwise.
-Kevin Murphy
^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2005-06-24 21:18 UTC | newest]
Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-02-18 17:41 Statement setNull for Types.CLOB Matt Magoffin <postgresql.org@msqr.us>
2005-02-18 20:10 ` Kris Jurka <books@ejurka.com>
2005-06-24 21:18 Re: Statement setNull for Types.CLOB Kevin Murphy <murphy@genome.chop.edu>
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