batchupdate的时候 如何打印出全部的sql语句?设置哪个参数?
t9eec4r01#
public LoggerBackupFilter() { this.setStatementExecutableSqlLogEnable(true); this.setResultSetLogEnabled(false); this.setConnectionLogEnabled(false); this.setDataSourceLogEnabled(false); this.setStatementCreateAfterLogEnabled(false); this.setStatementPrepareAfterLogEnabled(false); this.setStatementPrepareCallAfterLogEnabled(false); this.setStatementExecuteAfterLogEnabled(false); this.setStatementExecuteQueryAfterLogEnabled(false); this.setStatementExecuteUpdateAfterLogEnabled(false); // this.setStatementExecuteBatchAfterLogEnabled(false); this.setStatementCloseAfterLogEnabled(false); this.setStatementParameterSetLogEnabled(false); this.setStatementParameterClearLogEnable(false); this.setStatementLogErrorEnabled(false); }
irtuqstp2#
`sqlMapClientTemplate.execute(new SqlMapClientCallback() {@OverRidepublic Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {executor.startBatch();
for (int i = 0; i < list.size(); i++) { T o = list.get(i); executor.update(o.getClass().getSimpleName() + POSTFIX_UPDATE_SELECTIVE, o); } executor.executeBatch(); return null; } });
`
svgewumm3#
Mapper 包的日志级别设为 DEBUG 级别就可以了https://www.cnblogs.com/expiator/p/8664977.html
3条答案
按热度按时间t9eec4r01#
public LoggerBackupFilter() { this.setStatementExecutableSqlLogEnable(true); this.setResultSetLogEnabled(false); this.setConnectionLogEnabled(false); this.setDataSourceLogEnabled(false); this.setStatementCreateAfterLogEnabled(false); this.setStatementPrepareAfterLogEnabled(false); this.setStatementPrepareCallAfterLogEnabled(false); this.setStatementExecuteAfterLogEnabled(false); this.setStatementExecuteQueryAfterLogEnabled(false); this.setStatementExecuteUpdateAfterLogEnabled(false); // this.setStatementExecuteBatchAfterLogEnabled(false); this.setStatementCloseAfterLogEnabled(false); this.setStatementParameterSetLogEnabled(false); this.setStatementParameterClearLogEnable(false); this.setStatementLogErrorEnabled(false); }
irtuqstp2#
`
sqlMapClientTemplate.execute(new SqlMapClientCallback() {
@OverRide
public Object doInSqlMapClient(SqlMapExecutor executor) throws SQLException {
executor.startBatch();
`
svgewumm3#
Mapper 包的日志级别设为 DEBUG 级别就可以了
https://www.cnblogs.com/expiator/p/8664977.html