Skip site navigation (1) Skip section navigation (2)

setFetchSize question

From: Alan Stange <stange(at)rentec(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: setFetchSize question
Date: 2005-02-25 16:12:38
Message-ID: 421F4E76.508@rentec.com (view raw or flat)
Thread:
Lists: pgsql-jdbc
Hello all,

I just noticed something and I thought I'd ask:

When reading large chunks of data in the 7.4 JDBC client I would code 
something like this:

conn.setAutoCommit(false);
st.setFetchDirection(ResultSet.FETCH_FORWARD);
st.setFetchSize(1000);
st.executeQuery("select * from foo");

which would result in queries to the postgresql server like this:

DECLARE JDBC_CURS_588 CURSOR FOR select * from foo; fetch forward 1000 
from JDBC_CURS_588;

with subsequent fetch forward queries being executed as the full result 
set is pulled in.

In the 8.0 driver I don't see this happening.   I see only the "select * 
from foo" query in the postgresql server log.

Is the query result still being sent in batch chunks of 1000 rows, but 
using a different mechanism?

Thanks!

-- Alan



Responses

pgsql-jdbc by date

Next:From: Dave SmithDate: 2005-02-25 16:21:10
Subject: Re: setFetchSize question
Previous:From: Tom LaneDate: 2005-02-25 15:13:23
Subject: Re: Where are we on stored procedures?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group