You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by "Hemant.Kamatgi" <He...@target.com> on 2007/10/01 23:17:53 UTC

SQL fired by iBATIS

Hi,

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.

Can anyone please let me know abt this?

Regards
Hemant




Re: SQL fired by iBATIS

Posted by Jeff Butler <je...@gmail.com>.
See the developer's guide about enabling iBATIS logging.

Jeff Butler



On 10/1/07, Hemant. Kamatgi <He...@target.com> wrote:
>
>  Hi,
>
>
>
> 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.
>
>
>
> Can anyone please let me know abt this?
>
>
>
> Regards
>
> Hemant
>
>
>
>
>
>
>

Re: SQL fired by iBATIS

Posted by Jeff Butler <je...@gmail.com>.
Yes...

select foo
from bar
fetch first 200 rows only

Jeff Butler


On 10/2/07, Larry Meadors <lm...@apache.org> wrote:
>
> 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.
>
> Larry
>
>
> On 10/2/07, Hemant. Kamatgi <He...@target.com> wrote:
> > Hi,
> >
> > 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 very badly?
> >
> > Rgds
> > Hemant
> >
> > -----Original Message-----
> > From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf
> Of Larry Meadors
> > Sent: Monday, October 01, 2007 9:16 PM
> > To: user-java@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).
> >
> > Larry
> >
> >
> > > 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.
> >
>

Re: SQL fired by iBATIS

Posted by Larry Meadors <lm...@apache.org>.
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.

Larry


On 10/2/07, Hemant. Kamatgi <He...@target.com> wrote:
> Hi,
>
> 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 very badly?
>
> Rgds
> Hemant
>
> -----Original Message-----
> From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf Of Larry Meadors
> Sent: Monday, October 01, 2007 9:16 PM
> To: user-java@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).
>
> Larry
>
>
> > 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.
>

RE: SQL fired by iBATIS

Posted by "Hemant.Kamatgi" <He...@target.com>.
Hi,

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 very badly?

Rgds
Hemant

-----Original Message-----
From: larry.meadors@gmail.com [mailto:larry.meadors@gmail.com] On Behalf Of Larry Meadors
Sent: Monday, October 01, 2007 9:16 PM
To: user-java@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).

Larry


> 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.

Re: SQL fired by iBATIS

Posted by Larry Meadors <lm...@apache.org>.
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).

Larry


> 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.