Re: ResultSet internal data type handling

Поиск
Список
Период
Сортировка
От John Lister
Тема Re: ResultSet internal data type handling
Дата
Msg-id 4A092D2E.3070905@kickstone.com
обсуждение исходный текст
Ответ на ResultSet internal data type handling  (Luca Ferrari <fluca1978@infinito.it>)
Ответы Re: ResultSet internal data type handling
Список 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).
>
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

Thanks

JOHN



В списке pgsql-jdbc по дате отправления:

Предыдущее
От: Luca Ferrari
Дата:
Сообщение: ResultSet internal data type handling
Следующее
От: Oliver Jowett
Дата:
Сообщение: Re: ResultSet internal data type handling