The solution on the net is to set the following parameters in log4j: (e.g. http://my.oschina.net/wamdy/blog/468491)Log4j.logger.org.springframework.jdbc.core.jdbctemplate=debug
Log4j.logger.org.springframework.jdbc.core.statementcreatorutils=debug
However, the content that is printed after the setting contains only SQL statements and does not contain parameter information
After a multi-search is the solution above, then found here the result: http://stackoverflow.com/questions/1932208/ Seeing-the-underlying-sql-in-the-spring-jdbctemplate needs to be set:log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils
=trace JdbcTemplate is still set to debug
As follows: #输出SQL语句log4j.logger.org.springframework.jdbc.core.jdbctemplate=Debug #输出参数值log4j.logger.org.springframework.jdbc.core.statementcreatorutils=Trace
From for notes (Wiz)
JdbcTemplate: SQL with placeholders cannot print parameter information