You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by Jason Punzalan <ja...@gmail.com> on 2005/04/27 16:52:42 UTC

debugging sql statements

is there anyway to output the sql statement before the sql exception is 
thrown. i'm getting a syntax exception from oracle but i have no idea what 
the sql statement looks like. here's my current log4j.properties file...i 
can see the query sent for correct statements though. 

log4j.rootLogger=ERROR, stdout
# SqlMap logging configuration...
log4j.logger.com.ibatis=DEBUG
log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
log4j.logger.java.sql.Connection=DEBUG
log4j.logger.java.sql.Statement=DEBUG
log4j.logger.java.sql.PreparedStatement=DEBUG
log4j.logger.java.sql.ResultSet=DEBUG
# Console output...
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%5p [%t] - %m%n

Re: debugging sql statements

Posted by Brandon Goodin <br...@gmail.com>.
DEBUG should do it.

On 4/27/05, Jason Punzalan <ja...@gmail.com> wrote:
> is there anyway to output the sql statement before the sql exception is
> thrown. i'm getting a syntax exception from oracle but i have no idea what
> the sql statement looks like. here's my current  log4j.properties file...i
> can see the query sent for correct statements though. 
>  
>  log4j.rootLogger=ERROR, stdout
>  # SqlMap logging configuration...
>  log4j.logger.com.ibatis=DEBUG
>  log4j.logger.com.ibatis.common.jdbc.SimpleDataSource=DEBUG
>  log4j.logger.com.ibatis.common.jdbc.ScriptRunner=DEBUG
> log4j.logger.com.ibatis.sqlmap.engine.impl.SqlMapClientDelegate=DEBUG
>  log4j.logger.java.sql.Connection=DEBUG
>  log4j.logger.java.sql.Statement=DEBUG
>  log4j.logger.java.sql.PreparedStatement=DEBUG
>  log4j.logger.java.sql.ResultSet=DEBUG
>  # Console output...
>  log4j.appender.stdout=org.apache.log4j.ConsoleAppender
> log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
>  log4j.appender.stdout.layout.ConversionPattern=%5p [%t] -
> %m%n
>