X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id E202C529AE for ; Tue, 28 Jun 2005 17:25:28 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 41769-01 for ; Tue, 28 Jun 2005 20:25:27 +0000 (GMT) Received: from mail.routescape.com (mail.routescape.com [68.167.144.179]) by svr1.postgresql.org (Postfix) with ESMTP id 068DB529B8 for ; Tue, 28 Jun 2005 17:25:23 -0300 (ADT) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C57C1F.8433CF2A" X-MimeOLE: Produced By Microsoft Exchange V6.5.7226.0 Subject: prepared statement incompatibility Date: Tue, 28 Jun 2005 16:25:25 -0400 Message-ID: <6E0907A94904D94B99D7F387E08C4F57073220@FALCON.INSIGHT> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: prepared statement incompatibility Thread-Index: AcV8H4Q4oyLU/2IkS6qlOwajscIJQA== From: "Byron Nikolaidis" To: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.384 tagged_above=0 required=5 tests=HTML_60_70, HTML_MESSAGE, HTML_TEXT_AFTER_BODY, HTML_TEXT_AFTER_HTML X-Spam-Level: X-Archive-Number: 200506/146 X-Sequence-Number: 13108 This is a multi-part message in MIME format. ------_=_NextPart_001_01C57C1F.8433CF2A Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hello all, =20 We are using Postgres 8.0.3, and are attempting to upgrade to the JDBC 8.x drivers, but have discovered that PreparedStatements that used to work no longer do so. This is seen where the Java type does not match the database type, such as attempting to use preparedStatement.setString(1, "1") where the database type is actually an integer (see stacktrace below). These worked fine on previous driver versions (such as 7.4). =20 =20 If we set the protocolVersion=3D2, the jdbc 8.x drivers will work fine also, but I'm not so sure we really want to do that. =20 At first, I thought this was related to the use of server side prepares. But I have set the prepareThreshold=3D0 and verified it was being set by checking for it in the pgconnection and pgstatement, but it appears to have no effect. =20 Can anyone clarify what exactly has changed with prepared statements and why it used to work previously? =20 =20 Thanks, =20 Byron =20 Exception in thread "main" java.sql.SQLException: ERROR: column "ticket" is of type integer but expression is of type character varying at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecu torImpl.java:1471) at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImp l.java:1256) at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java: 175) at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Stateme nt.java:389) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdb c2Statement.java:330) at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2S tatement.java:282) at test.routescape.orm.util.DriverTest.main(DriverTest.java:49) =20 ------_=_NextPart_001_01C57C1F.8433CF2A Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hello all,

 

We are using Postgres 8.0.3, and are attempting to = upgrade to the JDBC 8.x drivers, but have discovered that PreparedStatements = that used to work no longer do so.   This is seen where the Java type = does not match the database type, such as attempting to use preparedStatement.setString(1, = “1”)   where the database type is actually an integer (see stacktrace = below).     These worked fine on previous driver versions (such as = 7.4).     

 

If we set the protocolVersion=3D2,  the jdbc 8.x = drivers will work fine also, but I’m not so sure we really want to do = that.

 

At first, I thought this was related to the use of = server side prepares.   But I have set the prepareThreshold=3D0 and = verified it was being set by checking for it in the pgconnection and pgstatement, but it appears to have no effect.

 

Can anyone clarify what exactly has changed with = prepared statements and why it used to work previously?    =

 

Thanks,

 

Byron

 

Exception in thread "main" = java.sql.SQLException: ERROR: column "ticket" is of type integer but expression is of = type character varying

        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecut= orImpl.java:1471)

        at = org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl= .java:1256)

        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:1= 75)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.execute(AbstractJdbc2Statemen= t.java:389)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeWithFlags(AbstractJdbc= 2Statement.java:330)

        at org.postgresql.jdbc2.AbstractJdbc2Statement.executeUpdate(AbstractJdbc2St= atement.java:282)

        at = test.routescape.orm.util.DriverTest.main(DriverTest.java:49)

 

=00 ------_=_NextPart_001_01C57C1F.8433CF2A--