Re: SQL fired by iBATIS
Larry Meadors <lmeadors <at> apache.org>
2007-10-02 15:30:59 GMT
Depends on the driver.
Does it support any "top N" and/or "bottom N" type queries?
If not, and you are looking to improve performance, you may want to
look into using stored procedures to do the limiting.
On 10/2/07, Hemant. Kamatgi <Hemant.Kamatgi <at> target.com> wrote:
> We are using DB2 server and it doesn't have a functionality as 'rownum' in oracle to limit the results.
Hence, we are using iBATIS's ''queryForList(String id,
> > Object parameterObject, int skip, int max)' to achieve the same. Does this de-grade the performance
> -----Original Message-----
> From: larry.meadors <at> gmail.com [mailto:larry.meadors <at> gmail.com] On Behalf Of Larry Meadors
> Sent: Monday, October 01, 2007 9:16 PM
> To: user-java <at> ibatis.apache.org
> Subject: Re: SQL fired by iBATIS
> The SQL is run exactly as it is in the sql map, but the (skip) results
> are skipped, and only (max) rows are mapped to objects.
> To answer what I think your question is: The limiting is done in Java,
> not in SQL.
> There is no SQL standard for limiting the results, so we let you do it
> this way (easy, but not terribly efficient), or in your SQL (harder,
> but lots more efficient).
> > I want to see the 'SQL' that iBATIS is firing to the Database. We are
> > curious to see how the results are fetched for 'queryForList(String id,
> > Object parameterObject, int skip, int max)' method.