pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Craig Ringer <craig@postnewspapers.com.au>
To: Michael musset <mickamusset@gmail.com>
Cc: Kris Jurka <jurka@ejurka.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Date: Sat, 23 Oct 2010 12:09:27 +0800
Message-ID: <4CC25FF7.7000308@postnewspapers.com.au> (raw)
In-Reply-To: <AANLkTikg5vHvq7sG4J8T7JBYiTdYZMROHgMCKTnDCCV2@mail.gmail.com>
References: <AANLkTikuYNnkRzRDUmJNJMv33E=97exppT44emqZRFFp@mail.gmail.com>
	<AANLkTin9XWGbK-p11oMLazZEbp2OLwX8qf_Yn2Ddx_Fo@mail.gmail.com>
	<alpine.BSO.2.00.1010210418110.30447@leary.csoft.net>
	<AANLkTin7XRgQb3qaU-TpCUDxfE_+xPK+07kUxYyK8=H4@mail.gmail.com>
	<4CBFF96E.1040800@ejurka.com>
	<AANLkTikg5vHvq7sG4J8T7JBYiTdYZMROHgMCKTnDCCV2@mail.gmail.com>

On 23/10/2010 11:53 AM, Michael musset wrote:
> So, what I have to do ?
>
> i've tried to convert my xml into String but it still doesn't work :
>
> ret.updateString("DATA", myXmlString);
>
>
> the error appear when i did a updaterow in my resultset
>
>
> the error is:
>
> org.postgresql.util.PSQLException: ERROR: column "DATA" is of type xml
> but expression is of type character varying
>    Hint: You will need to rewrite or cast the expression.

It's one of those irritating areas where PostgreSQL's overzealous 
refusal to cast ::text or ::varchar for interpretation as literals of 
another type bites you.

You need to use updateObject("DATA", java.sql.Types.SQLXML) so the JDBC 
driver knows what type to specify.

-- 
Craig Ringer

Tech-related writing at http://soapyfrogs.blogspot.com/



view thread (11+ messages)  latest in thread

Message-ID: <4CC25FF7.7000308@postnewspapers.com.au>
Permalink:  ../4CC25FF7.7000308@postnewspapers.com.au/
Also on:    postgresql.org/message-id/4CC25FF7.7000308@postnewspapers.com.au

 · 

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: craig@postnewspapers.com.au, mickamusset@gmail.com, jurka@ejurka.com
  Subject: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
  In-Reply-To: <4CC25FF7.7000308@postnewspapers.com.au>
  References: <AANLkTikuYNnkRzRDUmJNJMv33E=97exppT44emqZRFFp@mail.gmail.com> <AANLkTin9XWGbK-p11oMLazZEbp2OLwX8qf_Yn2Ddx_Fo@mail.gmail.com> <alpine.BSO.2.00.1010210418110.30447@leary.csoft.net> <AANLkTin7XRgQb3qaU-TpCUDxfE_+xPK+07kUxYyK8=H4@mail.gmail.com> <4CBFF96E.1040800@ejurka.com> <AANLkTikg5vHvq7sG4J8T7JBYiTdYZMROHgMCKTnDCCV2@mail.gmail.com> <4CC25FF7.7000308@postnewspapers.com.au>

* 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