Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id CC4D0633092 for ; Tue, 12 May 2009 05:44:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 25790-04 for ; Tue, 12 May 2009 05:44:40 -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 5EA81632FAF for ; Tue, 12 May 2009 05:44:39 -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 1M3nbG-0002Lu-2f; Tue, 12 May 2009 20:44:34 +1200 Message-ID: <4A0936F1.3010005@opencloud.com> Date: Tue, 12 May 2009 20:44:33 +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> In-Reply-To: <200905120939.07478.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/56 X-Sequence-Number: 19606 Luca Ferrari wrote: > Having a look at jdbc2.AsbtractJDBC2ResultSet (the parent of all ResultSets) I > discovered that all data received from the server is handled internally as a > string (right?) and is converted from the getXXX methods into the appropriate > type. This means that you can actually write a getString on a date field > obtaining a valida date (and if you are lucky you can do something the > opposite). I'm curious to know if this is an implementation choice or a jdbc > specification and why the objects are not checked against the table metadata > (as the getInternalObject method does). There's a table in the JDBC spec that lists the basic type conversions that a JDBC driver must support. Most types can be converted to strings, from memory. -O