Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Using iBatis , How to get the SQL Statement that is executed based on SQL Id ?
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Naresh Jagatap  
View profile  
 More options May 25 2012, 2:33 am
From: Naresh Jagatap <nares...@gmail.com>
Date: Thu, 24 May 2012 23:33:39 -0700 (PDT)
Local: Fri, May 25 2012 2:33 am
Subject: Using iBatis , How to get the SQL Statement that is executed based on SQL Id ?

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);


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
c c  
View profile  
 More options May 25 2012, 9:16 am
From: c c <ele.test...@gmail.com>
Date: Fri, 25 May 2012 21:16:25 +0800
Local: Fri, May 25 2012 9:16 am
Subject: Re: Using iBatis , How to get the SQL Statement that is executed based on SQL Id ?
 if you config you log4j
you can easy see the sql in consloe;

2012/5/25 Naresh Jagatap <nares...@gmail.com>:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Dridi Boukelmoune  
View profile   Translate to Translated (View Original)
 More options May 25 2012, 11:41 am
From: Dridi Boukelmoune <dridi.boukelmo...@zenika.com>
Date: Fri, 25 May 2012 17:41:51 +0200
Local: Fri, May 25 2012 11:41 am
Subject: Re: Using iBatis , How to get the SQL Statement that is executed based on SQL Id ?

Hi,

I believe it has been moved to the BoundSql class.
You can get the query from your mapped statement :

String sqlExecuted =
mappedStatement.getBoundSql(statementScope,object).getSql();

Dridi
http://www.zenika.com/

--

[image: http://www.whatsnextparis.com/images/sign/ligne.jpg]

*Dridi Boukelmoune***

Développeur/Formateur

GSM : +33 (0)6 17 91 14 23
dridi.boukelmo...@zenika.com

[image: http://www.whatsnextparis.com/images/sign/logo.jpg]
51, rue le Peletier - 75009 Paris
Tel : +33 (0)1 45 26 19 15

[image: http://www.whatsnextparis.com/images/sign/ligne.jpg]

  image001.jpg
< 1K Download

  image002.jpg
4K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
coalar  
View profile  
 More options Jul 27 2012, 3:48 am
From: coalar <75su...@gmail.com>
Date: Fri, 27 Jul 2012 00:48:49 -0700 (PDT)
Local: Fri, Jul 27 2012 3:48 am
Subject: Re: Using iBatis , How to get the SQL Statement that is executed based on SQL Id ?

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 님의 말:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »