Sun's cached rowset has a MaxRows property that you can use to limit the
number of rows returned. 

http://developer.java.sun.com/developer/Books/JDBCTutorial/chapter5.html

I'm not aware of a general way to offset a particular number of rows in
the a query that will work with everyting, which leaves fetching block 1
and block 2 to get to block 3. (Hoping 1 and 2 haven't changed in the
meantime).


-- Ted Husted, Husted dot Com, Fairport NY USA.
-- Custom Software ~ Technical Services.
-- Tel 716 737-3463.
-- http://www.husted.com/about/struts/

Mindaugas Idzelis wrote:
> 
> This may be a little off topic, please forgive me. One of my webapplications
> displays a group of results from a database query. These can be hundreds of
> rows long. I would like to break these up into smaller sections to fit on a
> page.
> 
> My problem is, I don't want to run the entire query at once and save it to
> memory.
> 
> PostgreSQL and MySQL have the LIMIT num,offset qualifier which does exactly
> what I want. The problem is that I'm using MS SQL and it doesn't use the
> LIMIT keyword. Instead, it uses TOP and you can't supply an offset.
> 
> My quetion: Is there anyway to specify an offset into a query using MS SQL
> Server? Thank you.
> 
> --min

Reply via email to