Re: ResultSet internal data type handling

From: Oliver Jowett <oliver(at)opencloud(dot)com>
To: Luca Ferrari <fluca1978(at)infinito(dot)it>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: ResultSet internal data type handling
Date: 2009-05-12 08:44:33
Message-ID: 4A0936F1.3010005@opencloud.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

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

In response to

Browse pgsql-jdbc by date

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