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 how to fetch some records at a time Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "how to fetch some records at a time" Watch "how to fetch some records at a time" New topic
Author

how to fetch some records at a time

krussi rong
Ranch Hand

Joined: Jan 30, 2002
Posts: 62
Hi everyone,
I dont know how to fetch some records at a time,
example, every time I only want to fetch 10
records. Does anyone know that?
thanks
Krussi
Jamie Robertson
Ranch Hand

Joined: Jul 09, 2001
Posts: 1879

if you are looking for ways to fetch 10 records, then fetch the next ten, etc... like some web pages, then have a look at this article which discusses this in detail. If you only want the first X number of rows, and that's it, have a look at the Statement.setMaxRows() method
Jamie
krussi rong
Ranch Hand

Joined: Jan 30, 2002
Posts: 62
thanks for reply,
I really want to look for ways to fetch 10 records, then fetch the next ten, etc...
I read the JDBC 2.0 API, and not sure
Statement.setFetchSize(10);
Statement.setFetchDirection(forward);
can deal with my problem?
Does anyone use this and know what the exactly
above function's usage?
thanks
Krussi
 
 
subject: how to fetch some records at a time