Skip site navigation (1) Skip section navigation (2)

Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar

From: Craig Ringer <craig(at)postnewspapers(dot)com(dot)au>
To: Michael musset <mickamusset(at)gmail(dot)com>
Cc: Kris Jurka <jurka(at)ejurka(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Date: 2010-10-23 04:09:27
Message-ID: 4CC25FF7.7000308@postnewspapers.com.au (view raw or flat)
Thread:
Lists: pgsql-jdbc
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/

In response to

Responses

pgsql-jdbc by date

Next:From: Michael mussetDate: 2010-10-23 04:20:58
Subject: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Previous:From: Michael mussetDate: 2010-10-23 03:53:04
Subject: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group