File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JDBC and the fly likes get part of ResultSet from a large table Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "get part of ResultSet from a large table" Watch "get part of ResultSet from a large table" New topic
Author

get part of ResultSet from a large table

ZhiningZhang
Greenhorn

Joined: Jun 13, 2001
Posts: 18

Hello, All,
Get ResultSet from "select * from mytable". But my talbe is too huge, I got error message (java.lang.OutOfMemoryError <<no stack trace available>>) .
Can I get ResultSet 100 rows each time? Is there any jdbc example for this solution?
" Select top 100 * from mytable " only gives me top 100, how can I get next 100 rows ???
Thanks! -Zhining
ZhiningZhang
Greenhorn

Joined: Jun 13, 2001
Posts: 18

how to use FetchSize in ResultSet? Can FetchSize solve my problem ?
Thanks! -Zhining
Anil Kumarknr
Greenhorn

Joined: Jun 21, 2001
Posts: 3
use stmt.setFetchSize(100). It will pick 100 records from the table each time.
rani bedi
Ranch Hand

Joined: Feb 06, 2001
Posts: 358
What should I do if I want to access the next 100 records after fetching the 100 records?


Cheers,<br />Rani<br />SCJP, SCWCD, SCBCD
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get part of ResultSet from a large table