Re: setFetchSize()

Поиск
Список
Период
Сортировка
От Dmitry Tkach
Тема Re: setFetchSize()
Дата
Msg-id 3F16D9DF.6050900@openratings.com
обсуждение исходный текст
Ответ на Re: setFetchSize()  (Felipe Schnack <felipes@ritterdosreis.br>)
Ответы Re: setFetchSize()  (Felipe Schnack <felipes@ritterdosreis.br>)
Список pgsql-jdbc
Felipe Schnack wrote:

>  Seems to me like a quite good solution! But why this is needed when autocommit is off? I can't understand.
>
>
Because you can only have cursors declared inside a transaction :-(

Dima

>On Thu, 17 Jul 2003 13:01:43 -0400
>Dmitry Tkach <dmitry@openratings.com> wrote:
>
>
>
>>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
>>
>>
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
>>
>>
>
>
>
>



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

Предыдущее
От: "Patric Bechtel"
Дата:
Сообщение: Re: setFetchSize() [Viruschecked]
Следующее
От: Dmitry Tkach
Дата:
Сообщение: Re: setFetchSize() [Viruschecked]