ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From suprememenu <shaik...@gmail.com>
Subject how to write Sql query in system out or to a log using ibatis?
Date Thu, 28 Jan 2010 11:04:33 GMT

hi all,
       Can anyone can guide me how can i write the sql query in system.out?

This query is in a.xml file

 <select id="getDetailsId" resultClass="Trans" parameterClass="string">
  	select sequenceId, 
  	name,
  	lastname,
  	mobileNo, 
  	 from mytable  where
  	Id=#Id# 
  </select>

when i call this query i need to write to the System.out the executing of
the query 

for 

System.out("The executing query is "+ 
select sequenceId, 
  	name,
  	lastname,
  	mobileNo, 
  	 from mytable  where
  	Id=25662);


when i use in normal jdbc connection

like for ex 
sql="select sequenceId, 
  	name,
  	lastname,
  	mobileNo, 
  	 from mytable  where
  	Id="+<%=id%>

System.out("The executing query is "+ sql);
rs.executeQuery(sql)

 
I tried to system.out to just know the query before executing .
-- 
View this message in context: http://old.nabble.com/how-to-write-Sql-query-in-system-out-or-to-a-log-using-ibatis--tp27354226p27354226.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


Mime
View raw message