Re: ResultSet internal data type handling

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet internal data type handling
Date: 2009-05-12 10:03:25
Message-ID: 200905121203.25544.fluca1978@infinito.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

On Tuesday 12 May 2009 10:02:54 am John Lister's cat walking on the keyboard
wrote:

> I believe the original wire protocol only supported text values hence
> the driver converts all data into a string before sending it to the
> server... Because of this the server will generally convert any value
> into the appropriate type (if this conversion is possible) which saves
> the driver from doing so. This simplifies the driver at the expense of
> extra network traffic and errors thrown by the server as opposed to the
> driver. The original authors can probably expand on this

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.

Luca

In response to

Responses

Browse pgsql-jdbc by date

  From Date Subject
Next Message John Lister 2009-05-12 10:08:57 Re: ResultSet internal data type handling
Previous Message Joe Kramer 2009-05-12 08:57:07 Re: Unable to access table named "user"