Re: ResultSet internal data type handling - Mailing list pgsql-jdbc

From Oliver Jowett
Subject Re: ResultSet internal data type handling
Date
Msg-id 4A094AC8.4050100@opencloud.com
Whole thread Raw
In response to Re: ResultSet internal data type handling  (Luca Ferrari <fluca1978@infinito.it>)
List pgsql-jdbc
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

pgsql-jdbc by date:

Previous
From: Luca Ferrari
Date:
Subject: Re: ResultSet internal data type handling
Next
From: John Lister
Date:
Subject: Re: ResultSet internal data type handling