当前位置:Gxlcms > 数据库问题 > jdbcTemplate:包含占位符的SQL无法打印参数信息

jdbcTemplate:包含占位符的SQL无法打印参数信息

时间:2021-07-01 10:21:17 帮助过:3人阅读


log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=debug 

但是设置后打印的内容只包含sql语句,不包含参数信息技术分享

经过多方寻找都是上文的解决方案,后来在此找到了结果:http://stackoverflow.com/questions/1932208/seeing-the-underlying-sql-in-the-spring-jdbctemplate 需要设置:log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=TraceJdbcTemplate 还是设为debug
如下:#输出SQL语句log4j.logger.org.springframework.jdbc.core.JdbcTemplate=debug#输出参数值log4j.logger.org.springframework.jdbc.core.StatementCreatorUtils=Trace
技术分享 




来自为知笔记(Wiz)

jdbcTemplate:包含占位符的SQL无法打印参数信息

标签:

人气教程排行