It would be very nice to figure out a way to do this in a platform independent manner, 
not very difficult either, imo.

it would have the advantage of limiting the db work (and use of cursors), if you knew 
how many items you really wanted back.

m


-----Original Message-----
From: Thomas Mahler [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, October 08, 2002 11:30 AM
To: OJB Users List
Subject: Re: LIMIT?


Hi Scott,

Scott W. Hill wrote:
> I'm using OJB with Postgresql, and want to use something like the LIMIT 
> restriction (to limit the number of returned results and therefore the 
> overhead for my app). What's the best approach to do this under OJB?
> 

You cannot use LIMIT directly as it's a propietary feature.
But the OJB Queries have a method setEndAtIndex(int) to tell the 
underlying resultset iterator when to stop materializing objects.
There is also a setStartAtIndex(int) to set an offset.
With these to methods you can build nice paging tools to display only 
certain amounts of data from a resultset at a time.

cheers
Thomas

> --Scott
> 
> 
> -- 
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to