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 DA10452812 for ; Tue, 21 Jun 2005 10:16:23 -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 90892-10 for ; Tue, 21 Jun 2005 13:16:17 +0000 (GMT) Received: from mosaic02.mosaic.de (mosaic02.mosaic.de [195.247.16.18]) by svr1.postgresql.org (Postfix) with ESMTP id 4CC9052881 for ; Tue, 21 Jun 2005 10:16:15 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mosaic02.mosaic.de (Postfix) with ESMTP id 5FCB1778C0; Tue, 21 Jun 2005 15:16:49 +0200 (CEST) Received: from mosaic02.mosaic.de ([127.0.0.1]) by localhost (mosaic02.mosaic-ag.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 05237-09; Tue, 21 Jun 2005 15:16:48 +0200 (CEST) Received: by mosaic02.mosaic.de (Postfix, from userid 10) id C29DE778A3; Tue, 21 Jun 2005 15:16:48 +0200 (CEST) Received: from [172.17.1.87] (aupc287.mosaic-ag.com [172.17.1.87]) by mailsrv.mosaic-ag.com (Postfix) with ESMTP id B73D55626B; Tue, 21 Jun 2005 15:15:59 +0200 (CEST) Message-ID: <42B8130F.5000604@mosaic-ag.com> Date: Tue, 21 Jun 2005 15:15:59 +0200 From: Roland Walter User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; de-AT; rv:1.7.5) Gecko/20041217 X-Accept-Language: de-DE,de,en MIME-Version: 1.0 To: Jason Tesser Cc: pgsql-jdbc@postgresql.org Subject: Re: problem with types in new jdbc driver References: <1119358451.5337.3.camel@jtessermain> In-Reply-To: <1119358451.5337.3.camel@jtessermain> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: mosaic-ag.com X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.041 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200506/112 X-Sequence-Number: 13074 Jason Tesser schrieb: > I had posted this on the main postgres list and here is what Richard > Huxton said. I was wondering if one you you guys could shed some more > light on this for me. What has changed between the 7.4 driver and the > 8.0 driver to cause this problem? > The JDBC driver 8.0 uses real prepared statements of the database server. To do this the client-server protocol V3 is used, which needs to know the real type of a parameter. So you must use setString only with character values, setTimestamp with timestamp values, setLong with BIGINT and so on. The 7.4 JDBC driver did not use real prepared statements, it replaced the parameters on the client side. If you want to use setString with the 8.0 driver with timestamp values, you have to write the cast into the statement string. To be more compatible with other databases replace the setString with the set-method that fits the type and convert the String to a java.sql.Timestamp before. -- Roland Walter MOSAIC SOFTWARE AG Telefon: 02225/882-411 Fax: 02225/882-201 http://www.mosaic-ag.com ------- L E G A L D I S C L A I M E R --------- Die Informationen in dieser Nachricht sind vertraulich und ausschliesslich fuer den Adressaten bestimmt. Kenntnisnahme durch Dritte ist unzulaessig. Die Erstellung von Kopien oder das Weiterleiten an weitere, nicht originaere und benannte Adressaten ist nicht vorgesehen und kann ungesetzlich sein. Die Meinungen in dieser Nachricht stellen lediglich die Meinungen des Senders dar. Falls Sie vermuten, dass diese Nachricht veraendert wurde, setzen Sie sich mit dem Absender in Verbindung. Der Absender uebernimmt ohne weitere Ueberpruefung keine Verantwortung fuer die Richtigkeit und Vollstaendigkeit des Inhalts. Unbefugte Empfaenger werden gebeten, die Vertraulichkeit der Nachricht zu wahren und den Absender sofort ueber einen Uebertragungsfehler zu informieren. ------------------------------------------------------