Spring JDBC - prevent logging - INFO: Added defaul

2019-06-24 08:32发布

问题:

My standalone application uses Spring JDBC.

I see a lot of the following statements in System.out

Mar 28, 2013 6:42:12 PM org.springframework.jdbc.core.JdbcTemplate extractReturnedResults
INFO: Added default SqlReturnUpdateCount parameter named #update-count-1

How do I prevent these logs?

回答1:

I got around this by skipping the undeclared results, which I don't need anyway

JdbcTemplate jt = new JdbcTemplate(dataSource);
jt.setSkipUndeclaredResults(true);