pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Oliver Jowett <oliver@opencloud.com>
To: Luca Ferrari <fluca1978@infinito.it>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: ResultSet internal data type handling
Date: Tue, 12 May 2009 22:09:12 +1200
Message-ID: <4A094AC8.4050100@opencloud.com> (raw)
In-Reply-To: <200905121203.25544.fluca1978@infinito.it>
References: <200905120939.07478.fluca1978@infinito.it>
	<4A092D2E.3070905@kickstone.com>
	<200905121203.25544.fluca1978@infinito.it>

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



view thread (6+ messages)

Message-ID: <4A094AC8.4050100@opencloud.com>
Permalink:  ../4A094AC8.4050100@opencloud.com/
Also on:    postgresql.org/message-id/4A094AC8.4050100@opencloud.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: oliver@opencloud.com, fluca1978@infinito.it
  Subject: Re: ResultSet internal data type handling
  In-Reply-To: <4A094AC8.4050100@opencloud.com>
  References: <200905120939.07478.fluca1978@infinito.it> <4A092D2E.3070905@kickstone.com> <200905121203.25544.fluca1978@infinito.it> <4A094AC8.4050100@opencloud.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox