在log4j.properties增加如下配置:
#jdbcTemplate print sql
log4j.logger.org.springframework.jdbc.core.JdbcTemplate=debug
源码:
public int update(String sql) throws DataAccessException {
Assert.notNull(sql, "SQL must not be null");
if (this.logger.isDebugEnabled()) {
this.logger.debug("Executing SQL update [" + sql + "]");
}