Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id 9529F2E01E5 for ; Wed, 12 Dec 2007 19:21:50 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76845-08 for ; Wed, 12 Dec 2007 19:21:48 -0400 (AST) Received: from fep02.xtra.co.nz (fep02.xtra.co.nz [210.54.141.244]) by postgresql.org (Postfix) with ESMTP id 218742E01D0 for ; Wed, 12 Dec 2007 19:21:46 -0400 (AST) Received: from mta04.xtra.co.nz ([172.23.11.41]) by fep02.xtra.co.nz with ESMTP id <20071212232132.BQJG2887.fep02.xtra.co.nz@mta04.xtra.co.nz> for ; Thu, 13 Dec 2007 12:21:32 +1300 Received: from fep03.xtra.co.nz ([172.23.12.31]) by mta04.xtra.co.nz with ESMTP id <20071212232132.FZFQ28381.mta04.xtra.co.nz@fep03.xtra.co.nz> for ; Thu, 13 Dec 2007 12:21:32 +1300 Received: from x1000.msqr.us ([125.236.166.183]) by fep03.xtra.co.nz with ESMTP id <20071212232132.GYKM18083.fep03.xtra.co.nz@x1000.msqr.us> for ; Thu, 13 Dec 2007 12:21:32 +1300 Received: from x1000.msqr.us (x1000.msqr.us [127.0.0.1]) by x1000.msqr.us (8.13.1/8.13.1) with ESMTP id lBCNLUC9027331 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 13 Dec 2007 12:21:31 +1300 Received: (from apache@localhost) by x1000.msqr.us (8.13.1/8.13.1/Submit) id lBCNLOG7027330; Thu, 13 Dec 2007 12:21:24 +1300 Received: from 192.168.1.108 (SquirrelMail authenticated user matt) by msqr.us with HTTP; Thu, 13 Dec 2007 12:21:24 +1300 (NZDT) Message-ID: <50753.192.168.1.108.1197501684.squirrel@msqr.us> In-Reply-To: <51046.192.168.1.108.1197434523.squirrel@msqr.us> References: <51046.192.168.1.108.1197434523.squirrel@msqr.us> Date: Thu, 13 Dec 2007 12:21:24 +1300 (NZDT) Subject: Re: how to set a PreparedStatement column of XML type in 8.3? From: "Matt Magoffin" To: pgsql-jdbc@postgresql.org User-Agent: SquirrelMail/1.4.8-4.0.1.el4 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/78 X-Sequence-Number: 17933 > 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@