Hello Jens,

sorry that I did not manage to answer your question earlier.

I don't excactly know why you need to do that, because normally only rows that 
are requested by the client (through a call to Resultset.next()) are fected 
from the server. In fact I have been using JDBC for over 10 years, but I never 
needed to set the fetch size (but maybe I just wasn't aware of the benefit)

At the moment there is no simple way to set the fetchsize. However what you can 
always do is to override the corresponding method and provide your own 
implmentation.
In your case this would mean that you would have to override the method 

        DBDatabase.executeQuery(String sqlCmd, Object[] sqlParams, boolean 
scrollable, Connection conn)

This method creates an JDBC Statement or Prepared Statement and executes it. 
This would give you the opportunity to set the fetch size to a desired value.

Depending on which RDMS-System you are using you will have to subclass the 
corresponding driver class in order to do that (e.g. 
org.apache.empire.db.hsql.DBDatabaseDriverHSql for HSQLDB).

I hope this answer helped you a bit.
If you can convince us that this is a "must have" feature than we might think 
of a more convienent way to set the fetch size.

Best regards
Rainer


> from: [email protected] [mailto:[email protected]]
> to: [email protected]
> re: SetFetchSize
> 
> Hi all!
> 
> Is it possible to set the fetchsize to prevent hugh datasets get loaded
> into memory?
> 
> I can set it on the prepared statement but is this possible in empire,
> too?
> 
> 
> Thanks
> 
> Jens
> 

Reply via email to