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 DE5BE52834 for ; Wed, 25 May 2005 10:57:12 -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 99508-05 for ; Wed, 25 May 2005 13:57:07 +0000 (GMT) Received: from mosaic02.mosaic.de (mosaic02.mosaic.de [195.247.16.18]) by svr1.postgresql.org (Postfix) with ESMTP id CCC1952836 for ; Wed, 25 May 2005 10:57:03 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by mosaic02.mosaic.de (Postfix) with ESMTP id E0E85778A3; Wed, 25 May 2005 15:57:40 +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 21269-01; Wed, 25 May 2005 15:57:39 +0200 (CEST) Received: by mosaic02.mosaic.de (Postfix, from userid 10) id DC86C77883; Wed, 25 May 2005 15:57:39 +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 D2C855625F; Wed, 25 May 2005 15:53:43 +0200 (CEST) Message-ID: <42948367.9050009@mosaic-ag.com> Date: Wed, 25 May 2005 15:53:43 +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: "Sergey A. Sokolov" Cc: pgsql-jdbc@postgresql.org Subject: Re: BIGINT <-> java.lang.String auto cast References: In-Reply-To: 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.056 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/102 X-Sequence-Number: 12933 Sergey A. Sokolov schrieb: > Hello all, > > I would appreciate if JDBC development team consider my message as a feature > request for Postgres JDBC 8.xx drivers. > > My issue is the following: in our application we use java.lang.String for > holding Identifier values of the database objects (portability, > extensibility, etc...), while PostgreSQL schema implementation have ID > fields as BIGINT's (or BIGSERIAL's) for most of the objects. We use some > stored procedures/functions in order to access and modify the data and, > certainly, have to pass ID values there from Java. > > We use "PreparedStatement.setString(index, id);"-like statements in Java for > this kind of fields and everything works fine with JDBC drivers version 7.4 > -- I mean autocast works and stored procedure/function is being found and > called correctly. > When we moved to Postgres JDBC version 8.0, or 8.1dev -- we've ran into the > problem of getting exceptions like > > org.postgresql.util.PSQLException: ERROR: function proc_test(character > varying) does not exist > As I followed this mailinglist, this is a feature of version 8.x and you must use the setXXX-Method that fits the type of the parameter. In your case setLong(index, id). This feature was introduced to use real Prepared-Statements with the protocol v3 for client-server-communication of the database. Regards, Roland. -- 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. ------------------------------------------------------