Adjust the log4j running level of ibatis to debug. You can print the SQL statements run by ibatis on the console.
### Set the logger output level and output destination ###
Log4j. rootlogger = debug, stdout, logfile
### Output log information to the console ###
Log4j. appender. stdout = org. Apache. log4j. leleappender
# Log4j. appender. stdout. Target = system. Err
Log4j. appender. stdout. layout = org. Apache. log4j. simplelayout
### Output log information to the file: jbit. Log ###
Log4j. appender. logfile = org. Apache. log4j. fileappender
Log4j. appender. logfile. File = jbit. Log
Log4j. appender. logfile. layout = org. Apache. log4j. patternlayout
Log4j. appender. logfile. layout. conversionpattern = % d {yyyy-mm-dd hh: mm: SS} % F % P % m % N
### Show SQL statements
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
Original post address: http://blog.csdn.net/hanzhou4519/article/details/7763412