问题
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);
回答2:
You can write the function call in the following format:
Select function_name(args) from dual;
With the above query, you can use any matching function in JdbcTemplate
Hope this helps you solve the issue.
来源:https://stackoverflow.com/questions/15685354/spring-jdbc-prevent-logging-info-added-default-sqlreturnupdatecount-paramet