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 5D3AC563C2 for ; Tue, 8 Mar 2005 11:07:54 +0000 (GMT) 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 28424-03 for ; Tue, 8 Mar 2005 11:07:50 +0000 (GMT) Received: from svr2.postgresql.org (unknown [65.19.161.25]) by svr1.postgresql.org (Postfix) with ESMTP id 35D3D55965 for ; Tue, 8 Mar 2005 11:07:49 +0000 (GMT) Received: from caesar (jambo2.idfix.nl [213.84.65.164]) by svr2.postgresql.org (Postfix) with SMTP id 76ED9F0C0E for ; Tue, 8 Mar 2005 11:05:04 +0000 (GMT) Received: from jambo2.idfix.nl ([213.84.65.164]) by caesar (JAMES SMTP Server 2.2.0) with SMTP ID 175 for ; Tue, 8 Mar 2005 12:06:11 +0100 (CET) From: "Silvio Bierman" To: "PostgreSQL JDBC" Subject: PreparedStatement#setString on non-string parameters Date: Tue, 8 Mar 2005 12:06:10 +0100 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200503/61 X-Sequence-Number: 12454 Hello all, I have just finished a few hours of testing our product that already runs on Oracle, SQLServer, MySQL, MaxDB and McKOI on PostgreSQL. I always liked what I read about this database apart from the fact that it used to not run natively on Windows. Since many of our customers run Windows servers I never bothered with PostgreSQL before. However, starting with version 8 there is a native Windows version which I installed and ran our product on. At first everything was fine and I was very impressed with both the performance as the ease of use of the admin tools. But when I starting doing writes to the database SQL exceptions started to occur. They where all over the application code but where all the same error: doing a setString on a numeric parameter. I know this is usually suboptimal but since we handle a lot of XML data throughout the (heavily distributed) application many numeric values are available as Strings so it would be a matter of converting them to numeric values ourselves or letting the JDBC driver do that. The JDBC drivers we used for the other databasse I mentioned never complained. Unfortunately PostgreSQL does. I read somewhere that using the pre-version-8 JDBC driver will work with 8 and not show this behaviour, the 8 driver has deliberately changed the behaviour. The JDBC spec requires the driver to attempt a conversion when a setString is done on a non-string parameter. This will break a lot of conformant code, not only ours. Is there any chance this can be corrected? Regards, Silvio Bierman