db-torque-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Thomas Fischer <fisc...@seitenbau.net>
Subject RE: How to fetch the rows with Peer class
Date Tue, 05 Apr 2005 10:40:58 GMT




Hi,

you can use the criteria.setLimit() and setOffset() methods to limit the
numbers of datasets to retrieve. Then you can iterate through the whole
table by increasing the offset in a loop, until you find no more datasets.

Hope that is what you were looking for.

     Thomas

Kenji Ichikawa <ichikawa@seta.co.jp> schrieb am 05.04.2005 04:00:30:

>
> Hello, I'm ichikawa.
>
> I would like to implement to fetch the rows with Peer class of Torque,
> becase the table row size is too large, so probably OutOfMemoryError
> will heppen if the following code is executed.
>
>
>
> Criteria criteria = new Criteria();
> List list = MyTablePeer.doSelect( criteria );
>
>
>
> I would like to know how to fetch the rows with Peer class,
> it's like the following code of JDBC implementation.
>
>
>
> Statement st = conn.createStatement();
> st.setFetchSize(50);
> ResultSet rs = st.executeQuery("SELECT * FROM my_table");
> while (rs.next()) {
>     System.out.print("a row was returned.");
> }
> rs.close();
> st.close();
>
>
>
> If you know how to do, Could you give me advice ?
>
>
>
>
>
> ---------------------------
> Kenji Ichikawa
> mailto:ichikawa@seta.co.jp
> http://www.seta.co.jp/
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
> For additional commands, e-mail: torque-user-help@db.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: torque-user-unsubscribe@db.apache.org
For additional commands, e-mail: torque-user-help@db.apache.org


Mime
View raw message