Re: setFetchSize()

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Re: setFetchSize()
Дата
Msg-id 3F16D677.3010300@openratings.com
обсуждение исходный текст
Ответ на setFetchSize()  (Rich Cullingford <rculling@sysd.com>)
Ответы Re: setFetchSize()  (Felipe Schnack <felipes@ritterdosreis.br>)
Re: setFetchSize() [Viruschecked]  ("Patric Bechtel" <bechtel@ipcon.de>)
Список pgsql-jdbc
Rich Cullingford wrote:

> All,
> Will this function be implemented in Release 7.4? I have several arge
> tables that run Java out of memory when I attempt to load them through
> JDBC. Any workarounds arppreciated...

I was using cursors for a while as a workaround...
Something like this:

c.setAutocommit (false);
Statement s = c.createStatement ();
s.execute ("declare foo cursor for select * from bar");

while (true)
{
    ResultSet rs = s.executeQuery ("fetch 10 from foo");
    int count = 0;
    while (rs.next ())
    {
        count++;
        doStuffWithThisRow (rs);
     }

     if (count < 10) //The whole cursor contents has been processed
          break;
}


I hope, it helps...

Dima



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

Предыдущее
От: Kris Jurka
Дата:
Сообщение: Re: JDBC driver compilation error
Следующее
От: Felipe Schnack
Дата:
Сообщение: Re: setFetchSize()