pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Magoffin <postgresql.org@msqr.us>
To: pgsql-jdbc@postgresql.org
Subject: Re: how to set a PreparedStatement column of XML type in 8.3?
Date: Thu, 13 Dec 2007 12:21:24 +1300 (NZDT)
Message-ID: <50753.192.168.1.108.1197501684.squirrel@msqr.us> (raw)
In-Reply-To: <51046.192.168.1.108.1197434523.squirrel@msqr.us>
References: <51046.192.168.1.108.1197434523.squirrel@msqr.us>

> I'm using the 8.3dev-602 JDBC driver, trying to set the value of an "xml"
> type column in an 8.3 database. The driver keeps throwing exceptions like
>
> ERROR: column "xml" is of type xml but expression is of type character
> varying
>
> I've tried a variety of different ways, including pstmt.setString,
> pstmt.setObject, and pstmt.setObject passing in Types.OTHER.
>
> What is the correct way to set a statement parameter value for an xml
> column?
>
> Thanks,
> m@

I am able to work around the issue by setting a PGObject value with the
type set to "xml" and the value my XML String. Is this the way the driver
is expected to work, or should it map Strings to the xml type
automatically in 8.3?

-- m@




view thread (14+ messages)  latest in thread

Message-ID: <50753.192.168.1.108.1197501684.squirrel@msqr.us>
Permalink:  ../50753.192.168.1.108.1197501684.squirrel@msqr.us/
Also on:    postgresql.org/message-id/50753.192.168.1.108.1197501684.squirrel@msqr.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: postgresql.org@msqr.us
  Subject: Re: how to set a PreparedStatement column of XML type in 8.3?
  In-Reply-To: <50753.192.168.1.108.1197501684.squirrel@msqr.us>
  References: <51046.192.168.1.108.1197434523.squirrel@msqr.us> <50753.192.168.1.108.1197501684.squirrel@msqr.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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