ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex Sherwin <alex.sher...@acadiasoft.com>
Subject Re: iBatis - MySQL pagination
Date Fri, 15 May 2009 16:48:06 GMT
I'm not an expert, but I think the answer is that standard SQL doesn't 
provide this mechanism, making it's implementation database dependent.  
iBATIS is providing a mechanism for skip/max that will work with any DB 
(quite possibly inefficiently), but at least the feature is there.

To be more efficient, you just need to do it per DB like you've noted 
with MySQL and LIMIT

Alin Popa wrote:
> Thanks Larry for your quick response.
>
> If I'm doing it in Mysql statement, I'll do it using LIMIT which is
> taking exactly the same 2 params like ibatis (skipResults and
> maxRecords).
>
> My dilemma is: why ibatis is doing this kind of abstraction if on the
> underlying server is doing it wrong ? Might cause confusion and of
> course, bad performances. I asked the question here, because I thought
> that I'm missing something related to this pagination issue.
>
>
> On Fri, May 15, 2009 at 7:15 PM, Larry Meadors <larry.meadors@gmail.com> wrote:
>   
>> Do it in the sql statement instead of using pagination in ibatis.
>>
>> Look at limit, row_count and offset here:
>>
>> http://dev.mysql.com/doc/refman/5.0/en/select.html
>>
>> You will probably need to use $substitution$ for the parameters, but
>> surely some mysql stud can tell you more about that than I can. :)
>>
>> Larry
>>
>>     
>
>
>
>   



Mime
View raw message