You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@turbine.apache.org by 贾铁军 <ji...@neusoft.com> on 2002/04/23 07:41:09 UTC

How to paging dabase results

Hi,
I will paging the results from datbase. the first solution is get all of data from database then deal something(I am using it). however, it will cost much resource. then I want get a page of data from data every time. I want to know whether TDK supports limit and offset. as I know, ms sql uses "select top n * .." and mysql uses "limit m,n", so I want to know limit and offset works for any database?
thank you!

Reimon

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: How to paging dabase results

Posted by Kelvin Tan <ke...@relevanz.com>.
Use criteria.setLimit and criteria.setOffset.

I haven't tried it on any other database except MySql, but I don't see why
it shouldn't work. Try it!

Kelvin
----- Original Message -----
From: "贾铁军" <ji...@neusoft.com>
To: "Turbine Users List" <tu...@jakarta.apache.org>
Sent: Tuesday, April 23, 2002 1:41 PM
Subject: How to paging dabase results


> Hi,
> I will paging the results from datbase. the first solution is get all of
data from database then deal something(I am using it). however, it will cost
much resource. then I want get a page of data from data every time. I want
to know whether TDK supports limit and offset. as I know, ms sql uses
"select top n * .." and mysql uses "limit m,n", so I want to know limit and
offset works for any database?
> thank you!
>
> Reimon
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>