Spring JDBC - prevent logging - INFO: Added default SqlReturnUpdateCount parameter named #update-count-1

拜拜、爱过 提交于 2019-12-10 17:21:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!