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 7E65A56473 for ; Tue, 8 Mar 2005 21:23:53 +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 00629-05 for ; Tue, 8 Mar 2005 21:23:50 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id C03E7563BE for ; Tue, 8 Mar 2005 21:23:41 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D8mB0-0003x9-00; Wed, 09 Mar 2005 10:23:38 +1300 Message-ID: <422E17D5.9080109@opencloud.com> Date: Wed, 09 Mar 2005 10:23:33 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Silvio Bierman Cc: PostgreSQL JDBC Subject: Re: PreparedStatement#setString on non-string parameters References: In-Reply-To: X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/74 X-Sequence-Number: 12466 Silvio Bierman wrote: > 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? AFAIK, the spec doesn't require this. Can you point me at the bit of the spec that makes you think it does? As I read the spec, the only conversions the driver performs for IN parameters are those in table B-2 (for String, to CHAR/VARCHAR/LONGVARCHAR) or B-4 (same mapping for String). See 13.2.2.1 and 13.2.2.2 of the JDBC 3.0 spec. There is a wider set of conversions available on the ResultSet path (notably, integer -> string) -- see 14.2.3.1 and table B-6. -O