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 2F9CD54D3A for ; Tue, 8 Mar 2005 13:20:22 +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 62490-03 for ; Tue, 8 Mar 2005 13:20:17 +0000 (GMT) Received: from mnc.ch (unknown [212.23.250.43]) by svr1.postgresql.org (Postfix) with ESMTP id C569A53C92 for ; Tue, 8 Mar 2005 13:20:15 +0000 (GMT) Received: (qmail 1574 invoked from network); 8 Mar 2005 14:20:19 +0100 Received: from 62-2-77-204.business.cablecom.ch (HELO meuh.mnc.ch) (62.2.77.204) by www.mnc.ch.com with SMTP; 8 Mar 2005 14:20:19 +0100 Received: by meuh.mnc.ch (Postfix, from userid 1000) id B500E23F50B; Tue, 8 Mar 2005 14:20:15 +0100 (CET) To: "Silvio Bierman" Cc: "PostgreSQL JDBC" Subject: Re: PreparedStatement#setString on non-string parameters References: From: Guillaume Cottenceau Date: 08 Mar 2005 14:20:15 +0100 In-Reply-To: Message-ID: <87k6oil1f4.fsf@meuh.mnc.ch> Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.052 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/65 X-Sequence-Number: 12458 "Silvio Bierman" writes: [...] > 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? Where can you see that? I can see pretty much the opposite, for example the following at http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html -=-=---=-=---=-=---=-=---=-=-- Note: The setter methods (setShort, setString, and so on) for setting IN parameter values must specify types that are compatible with the defined SQL type of the input parameter. For instance, if the IN parameter has SQL type INTEGER, then the method setInt should be used. -=-=---=-=---=-=---=-=---=-=-- And even, at http://java.sun.com/j2se/1.4.2/docs/api/java/sql/PreparedStatement.html#setString(int,%20java.lang.String) -=-=---=-=---=-=---=-=---=-=-- setString: The driver converts this to an SQL VARCHAR or LONGVARCHAR value (depending on the argument's size relative to the driver's limits on VARCHAR values) when it sends it to the database. -=-=---=-=---=-=---=-=---=-=-- -- Guillaume Cottenceau