ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nathan Maves <Nathan.Ma...@Sun.COM>
Subject Re: get the statement
Date Wed, 08 Mar 2006 18:15:16 GMT
The logging will give you all the information that you need.

Ex.

select * from table where id = #id#

The logging will show you the PS

select * from table where id = ?

And then show you the parameters.  You will be able to see just what  
is being called.  The only gotcha is that you can not copy and paste  
the sql in one shot.  You have to do the substitution for the  
parameters yourself.

Give it a try :)


Nathan


On Mar 8, 2006, at 10:09 AM, Lurtz Ugluk wrote:

> I've look the link above and I read "Why? Because the
> only information we have available is the
> PreparedStatement and the parameters."
> That's that I need (I think ;-) ), with the
> preparedStatement I can get the SQL that I will
> execute, can't I?
> How can I get that PreparedStatement and its
> parameters at runtime ?
>
> More thanks
>
>  --- Nathan Maves <Nathan.Maves@Sun.COM> escribió:
>
>> Not really sure if you truly want to save the sql or
>> just look at if
>> for debugging purposes.
>>
>> If you are just trying to debug the look at setting
>> up logging for
>> your application.  The following page on the wiki
>> should help you set
>> that up.
>>
>>
> http://opensource2.atlassian.com/confluence/oss/display/IBATIS/How+do
>>
>> +I+get+SqlMapClient+to+log+SQL+statements
>>
>> Nathan
>>
>> On Mar 8, 2006, at 9:39 AM, Lurtz Ugluk wrote:
>>
>>>  How Can I get the sql statement that de iBatis
>>> execute?
>>> I need the sql statement at runtime to create a
>>> String and save it.
>>>
>>>  Thanks.
>>>
>>>
>>> 		
>>> ______________________________________________
>>> LLama Gratis a cualquier PC del Mundo.
>>> Llamadas a fijos y móviles desde 1 céntimo por
>> minuto.
>>> http://es.voice.yahoo.com
>>
>>
>
>
>
> 		
> ______________________________________________
> LLama Gratis a cualquier PC del Mundo.
> Llamadas a fijos y móviles desde 1 céntimo por minuto.
> http://es.voice.yahoo.com


Mime
View raw message