ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Larry Meadors" <larry.mead...@gmail.com>
Subject Re: Retrieve the SQL statement being executed
Date Mon, 10 Mar 2008 12:23:24 GMT
Depending on your iBATIS version, I think you can get to what you
want, but it is pretty fragile, because you have to do some casting to
internal classes which could change.

I think your safest bet is the RowHandler or a stored procedure - and
I say stored procedure only because it sounds like you need to process
a lot of data for just a little bit of information. If that is the
case, a SP will kick butt over everything else in terms of both memory
footprint and performance.


On Sun, Mar 9, 2008 at 8:44 PM, Ricky Murphy <rickytrsbin@hotmail.com> wrote:
> Thank you for your reply. Well, I have no problem doing log activity. let me
> elaborate what I want to do. I have a SQLMap file which contains all my SQLs
> maps related to the same domain. In one case, I need to use ResultSet
> directly and not need iBatis. However, I want to keep all domain related
> SQLs in the same place.    In iBatis, it seems there is no decent way to
> handle this (RowHandler seems to get the result up in memory (i,e, after
> data is obtained, the db connection is closed) first, then I can treat each
> row as a object. I don't want to go that extra step. To work with each row
> in ResultSet seemed to be efficient to me without extra steps. This is the
> only SQL that does not need iBatis. However, in order to keep all SQL maps
> that tackle the same domain of problems together, I want to put this special
> SQL together with sqlMaps together in the same XML file. Because this, I
> want sqlMapClient to somehow read the SQL and then in my code retrieve the
> SQL and execute it with Spring jdbcTemplate to get my resultSet. I hope that
> I explained clearly.
> iBatis has a session scope, and requestScope objects that seem to be OK to
> get the SQL statement. however, they are protect method and not open to
> public. Therefore, I am trying to see if there is any way to get that SQL
> before it is executed.
> -Rick
> ________________________________
> From: nathan.maves@gmail.com
> To: user-java@ibatis.apache.org
> Subject: Re: Retrieve the SQL statement being executed
> Date: Sat, 8 Mar 2008 07:33:38 -0700
> Please take a look at the logging section in one of the following 3
> places...
> The website
> The developers guide
> The book
> Sent from my iPhone
> On Mar 8, 2008, at 5:55 AM, Ricky Murphy <rickytrsbin@hotmail.com> wrote:
> Hello:
> I am using Spring 2 together with iBatis 2.2. I need in my program to
> retrieve the SQL statement being executed from the SqlMap.
> Spring's SqlMapClientDaoSupport class has getSqlMapClient() ,which gives
> com.ibatis.sqlmap.client.SqlMapClient as a result object, from there on, I
> started searching thru all related the iBatis classes, haven't found one
> method that will return the SQL statement being executed. Please advise.
> Thank you.
> -Rick
> ________________________________
> Connect and share in new ways with Windows Live. Get it n
> ________________________________
> Climb to the top of the charts! Play the word scramble challenge with star
> power. Play now!

View raw message