Обсуждение: Re: Backend Protocol

Поиск
Список
Период
Сортировка

Re: Backend Protocol

От
Barry Lind
Дата:
Dave,

This is documented in the Developer's Guide (Chapter 4 Frontend/Backend
Protocol of the 7.1 docs).

A few days ago I added this same item the the jdbc todo list.  I don't
think the implementation will need to do anything different at the FE/BE
protocol level.  Instead my thoughts on this are to wrap all jdbc
Statements/Prepared Statements doing selects in a sql cursor, and then
issuing fetch statements to set sets of rows instead of the entire
result set.

Thus 'select foo from bar'

Whould get executed by the driver as:

declare barcursor cursor as select foo from bar;

followed by:

fetch forward 10 from barcursor;

(to select the first 10 rows)

additional fetches as needed...

finally:

close barcursor;

Just when this should be done (i.e. you probably don't want to overhead
of using a cursor for every select statement), how many rows to fetch at
a time (perhaps you might want to fetch 100 rows per call to minimize
network roundtrips) would need to be configurable somehow.

Also not the the jdbc2 spec has methods for setCursorName(), etc. and
just how they would play into this I don't know.

thanks,
--Barry



Dave Cramer wrote:

> Hi,
>
> I am looking at changing the jdbc driver to be asynchronous, in other
> words retrieve the result set when asked as opposed to retrieving it all
> before returning.
>
> This will involve understanding the client/backend protocol completely.
> So far I have found one reference to this. Does anyone have a flow chart
> or can point me to any other references.
>
> Dave
>
>