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 724975284C for ; Thu, 26 May 2005 22:04:31 -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 15105-04 for ; Fri, 27 May 2005 01:04:30 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id EE60352848 for ; Thu, 26 May 2005 22:04:27 -0300 (ADT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.21]) by yass.opencloud.co.nz with asmtp (TLS-1.0:DHE_RSA_AES_128_CBC_SHA:16) (Exim 4.34) id 1DbTH5-0005y4-OE; Fri, 27 May 2005 13:04:31 +1200 Message-ID: <42967221.20505@opencloud.com> Date: Fri, 27 May 2005 01:04:33 +0000 From: Oliver Jowett User-Agent: Mozilla Thunderbird 0.8 (Windows/20040913) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pg@fastcrypt.com Cc: pgsql-jdbc@postgresql.org Subject: Re: BIGINT <-> java.lang.String auto cast References: <4294BAAE.4080106@fastcrypt.com> <42955CC9.6040306@opencloud.com> <4295B69E.1070308@fastcrypt.com> <42965917.7090206@opencloud.com> <4296675D.6060505@fastcrypt.com> <42966881.2000609@opencloud.com> <42966D6E.1080007@fastcrypt.com> In-Reply-To: <42966D6E.1080007@fastcrypt.com> 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.004 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200505/121 X-Sequence-Number: 12952 Dave Cramer wrote: > Where do you see the driver doing such conversions. In AbstractJdbc2Statement.setObject(int,Object,int,int), e.g.: > // Helper method that extracts numeric values from an arbitary Object. > private String numericValueOf(Object x) > { > if (x instanceof Boolean) > return ((Boolean)x).booleanValue() ? "1" : "0"; > else if (x instanceof Integer || x instanceof Long || > x instanceof Double || x instanceof Short || > x instanceof Number || x instanceof Float) > return x.toString(); > else > //ensure the value is a valid numeric value to avoid > //sql injection attacks > return new BigDecimal(x.toString()).toString(); > } [...] > switch (targetSqlType) > { > case Types.INTEGER: > bindLiteral(parameterIndex, numericValueOf(x), Oid.INT4); > break; [...] -O