empire-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Döbele <doeb...@esteam.de>
Subject re: SetFetchSize
Date Sun, 26 Aug 2012 19:28:28 GMT
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

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

> from: mailinglist@j-b-s.de [mailto:mailinglist@j-b-s.de]
> to: user@empire-db.apache.org
> 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

View raw message