iBatis get executed sql

Posted by qaxi on Stack Overflow See other posts from Stack Overflow or by qaxi
Published on 2010-04-14T05:19:51Z Indexed on 2010/04/14 5:23 UTC
Read the original article Hit count: 452

Filed under:
|
|
|

Hi all.

Is there any way where I can get the executed query of iBatis? I want to reuse the query for an UNION query.

For example:

<sqlMap namespace="userSQLMap">
   <select id="getUser" resultClass="UserPackage.User">
        SELECT username,
               password 
        FROM table 
        WHERE id=#value#
   </select>
</sqlMap>

And when I execute the query through

int id = 1
List<User> userList = queryDAO.executeForObjectList("userSQLMap.getUser",id)

I want to get SELECT username, password FROM table WHERE id=1

Is there any way I could get the query?

Thanks.

© Stack Overflow or respective owner

Related posts about ibatis

Related posts about java