jdbcTemplate打印sql

在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 + "]");
    }

猜你喜欢

转载自blog.csdn.net/cyj7696/article/details/81189857
今日推荐