Hi.
I need to get SQL just like you.
but your code is not working in my project
(Spring 2.5.6 + iBatis2.3.4.726 )
[Error line]
SqlMapExecutorDelegate delegate = sqlMapClient.getDelegate();
=> the method getDelegate() is undefined type for the string
mappedStatement.initRequest(statementScope);
=> Syntax error on token "statementScope", VariableDeclaratorId expected
after
this token
- Syntax error on token(s), misplaced construct(s)
Can I get your whole source ?
2012년 5월 25일 금요일 오후 3시 33분 39초 UTC+9, Naresh Jagatap 님의 말:
> Hi ,
> I have the iBatis SQL Id using which I need to get the corresponding SQL
> Statement.
> So I have written the below code . as of now this code seems to be
> working. but just want to know whether my approach is correct ?
> SqlMapExecutorDelegate delegate = sqlMapClient.getDelegate();
> MappedStatement mappedStatement = delegate.getMappedStatement(sqlId);
> Sql sql = mappedStatement.getSql();
> SessionScope sessionScope = new SessionScope();
> StatementScope statementScope = new StatementScope(sessionScope);
> mappedStatement.initRequest(statementScope);
> String sqlExecuted = sql.getSql(statementScope,object);