Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id C2787632FAF for ; Tue, 12 May 2009 07:09:21 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 88328-07 for ; Tue, 12 May 2009 07:09:12 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tremor.opencloud.co.nz (tremor.opencloud.co.nz [131.203.101.230]) by mail.postgresql.org (Postfix) with ESMTP id 66BE2635001 for ; Tue, 12 May 2009 07:09:17 -0300 (ADT) Received: from 219-89-243-186.adsl.xtra.co.nz ([219.89.243.186] helo=[192.168.1.3]) by tremor.opencloud.co.nz with esmtpsa (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.63) (envelope-from ) id 1M3ovA-0002ow-Od; Tue, 12 May 2009 22:09:12 +1200 Message-ID: <4A094AC8.4050100@opencloud.com> Date: Tue, 12 May 2009 22:09:12 +1200 From: Oliver Jowett User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: Luca Ferrari CC: pgsql-jdbc@postgresql.org Subject: Re: ResultSet internal data type handling References: <200905120939.07478.fluca1978@infinito.it> <4A092D2E.3070905@kickstone.com> <200905121203.25544.fluca1978@infinito.it> In-Reply-To: <200905121203.25544.fluca1978@infinito.it> X-Enigmail-Version: 0.95.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200905/59 X-Sequence-Number: 19609 Luca Ferrari wrote: > It is not clear to me: the driver is receiving always strings from the server, > and therefore must do the conversion by itself. The fact is that such > conversion is not checked against the table definition. I would expect an > SQLException if I try to read an integer as a string or viceversa. Instead the > conversion can work and the driver says nothing about. The JDBC spec says the driver does conversions depending on the ResultSet getter method you use. See table B-6 in appendix B of the JDBC spec. In this particular case, the table says you can getInt() on a VARCHAR and getString() on an INTEGER. -O