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

Поиск
Список
Период
Сортировка
От Michael musset
Тема Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Дата
Msg-id AANLkTik+WkUB-O8WG6YqX5My2xEN=dQEhvPvOyOOOR+f@mail.gmail.com
обсуждение исходный текст
Ответ на Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar  (Craig Ringer <craig@postnewspapers.com.au>)
Ответы Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Список pgsql-jdbc
Thanks,

sorry for my poor level in Java/JDBC :

but how do you use that ?

i've tried :

ret.updateObject("DATA",writer.toString() ,java.sql.Types.SQLXML);

but it's still doesn't work :

ERROR: column "DATA" is of type xml but expression is of type character varying
  Hint: You will need to rewrite or cast the expression.


neither this one :

ret.updateObject("DATA",(java.sql.Types.SQLXML)writer.toString());


sorry,

On Sat, Oct 23, 2010 at 6:09 AM, Craig Ringer <craig@postnewspapers.com.au> wrote:
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/

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar
Следующее
От: Michael musset
Дата:
Сообщение: Re: JDBC4 with SQLXML and postgresql-8.4-702.jdbc4.jar