Sunday, 24 April 2016

Scenario : How can I retrieve only the first n rows, second n rows of a database using a particular WHERE clause ?


SCENARIO
How can I retrieve only the first n rows, second n rows of a database using a particular WHERE clause ?

For example
If a SELECT typically returns a 1000 rows, how do first retrieve the 100 rows, then go back and retrieve the next 100 rows and so on.

Use the Statement.setFetchSize method to indicate the size of each database fetch.
Note that this method is only available in the Java 2 platform.

No comments:

Post a Comment

Note: only a member of this blog may post a comment.