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 joson yu <yu...@gmail.com> on 2009/05/26 10:52:40 UTC

how to get the sql string

Is there anymethod to get the sql string in the config file which will run
when called.
in my system,i need to record the sql string as log infomation,is there
anyway.

Notice,i know how to print the sql with log4j.   but i don't have any idea
to use it.

Re: how to get the sql string

Posted by joson yu <yu...@gmail.com>.
hi,Popa:
     really thanks for your reply.
     my really purpose is to get the SQLs,then i will save the SQLs as my
system log infomation. i thourght is there any method in the ibatis to get
the sql.but i have find it,and don't get the answer.

2009/5/26 Alin Popa <al...@gmail.com>

> Hi Joson,
>
> Afaik, the only way to display the executed query is by enabling logging
> for Connection ... etc.
> It will display the queries before preparation.
> As a workaround, I enable sql logging for server (mysql in my case).
> Indeed, it will really help if ibatis can display the SQLs in an explicit
> way (maybe something like hibernate does ?).
>
>
> On Tue, May 26, 2009 at 11:52 AM, joson yu <yu...@gmail.com> wrote:
>
>> Is there anymethod to get the sql string in the config file which will run
>> when called.
>> in my system,i need to record the sql string as log infomation,is there
>> anyway.
>>
>> Notice,i know how to print the sql with log4j.   but i don't have any idea
>> to use it.
>>
>
>
> --
> Best Regards,
>
> Alin
>
>

Re: how to get the sql string

Posted by Alin Popa <al...@gmail.com>.
Hi Joson,

Afaik, the only way to display the executed query is by enabling logging for
Connection ... etc.
It will display the queries before preparation.
As a workaround, I enable sql logging for server (mysql in my case).
Indeed, it will really help if ibatis can display the SQLs in an explicit
way (maybe something like hibernate does ?).

On Tue, May 26, 2009 at 11:52 AM, joson yu <yu...@gmail.com> wrote:

> Is there anymethod to get the sql string in the config file which will run
> when called.
> in my system,i need to record the sql string as log infomation,is there
> anyway.
>
> Notice,i know how to print the sql with log4j.   but i don't have any idea
> to use it.
>


-- 
Best Regards,

Alin