From: | Felipe Schnack <felipes(at)ritterdosreis(dot)br> |
---|---|
To: | Dmitry Tkach <dmitry(at)openratings(dot)com> |
Cc: | Rich Cullingford <rculling(at)sysd(dot)com>, pgsql-jdbc(at)postgresql(dot)org |
Subject: | Re: setFetchSize() |
Date: | 2003-07-17 17:01:10 |
Message-ID: | 20030717140110.52ca5fe2.felipes@ritterdosreis.br |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-jdbc |
Seems to me like a quite good solution! But why this is needed when autocommit is off? I can't understand.
On Thu, 17 Jul 2003 13:01:43 -0400
Dmitry Tkach <dmitry(at)openratings(dot)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(at)postgresql(dot)org
--
/~\ The ASCII Felipe Schnack (felipes(at)ritterdosreis(dot)br)
\ / Ribbon Campaign Analista de Sistemas
X Against HTML Cel.: 51-91287530
/ \ Email! Linux Counter #281893
Centro Universitário Ritter dos Reis
http://www.ritterdosreis.br
ritter(at)ritterdosreis(dot)br
Fone: 51-32303341
From | Date | Subject | |
---|---|---|---|
Next Message | Dmitry Tkach | 2003-07-17 17:01:43 | Re: setFetchSize() |
Previous Message | Kris Jurka | 2003-07-17 17:01:08 | Re: JDBC driver compilation error |