打印sql日志

更新时间:2023-07-23 03:36:47 阅读: 评论:0

打印sql⽇志
@Component
@Slf4j
public class SQLLogFilter extends FilterEventAdapter {物业经理
@Override
public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql)throws SQLException {
return super.statement_execute(chain, statement, sql);
}
家常菜大全菜谱@Override
public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql,int autoGeneratedKeys)throws SQLException { return super.statement_execute(chain, statement, sql, aut
oGeneratedKeys);
}
@Override
public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql,int[] columnIndexes)throws SQLException { return super.statement_execute(chain, statement, sql, columnIndexes);
}
@Override
public boolean statement_execute(FilterChain chain, StatementProxy statement, String sql, String[] columnNames)throws SQLException { return super.statement_execute(chain, statement, sql, columnNames);
}
@Override
public ResultSetProxy statement_executeQuery(FilterChain chain, StatementProxy statement, String sql)throws SQLException {
return super.statement_executeQuery(chain, statement, sql);
}
@Override
public int statement_executeUpdate(FilterChain chain, StatementProxy statement, String sql)throws SQLException {
return super.statement_executeUpdate(chain, statement, sql);
}
@Override
public int statement_executeUpdate(FilterChain chain, StatementProxy statement, String sql,int autoGeneratedKeys)throws SQLException { return super.statement_executeUpdate(chain, statement, sql, autoGeneratedKeys);
标准近义词}
@Override
public int statement_executeUpdate(FilterChain chain, StatementProxy statement, String sql,int[] columnIndexes)throws SQLException { return super.statement_executeUpdate(chain, statement, sql, columnIndexes);
}
@Override
public int statement_executeUpdate(FilterChain chain, StatementProxy statement, String sql, String[] columnNames)throws SQLException { return super.statement_executeUpdate(chain, statement, sql, columnNames);
}
@Override
protected void statementExecuteUpdateBefore(StatementProxy statement, String sql){
无氧运动
super.statementExecuteUpdateBefore(statement, sql);
}
精干@Override
protected void statementExecuteQueryBefore(StatementProxy statement, String sql){
super.statementExecuteQueryBefore(statement, sql);
}
@Override
protected void statementExecuteQueryAfter(StatementProxy statement, String sql, ResultSetProxy resultSet){
super.statementExecuteQueryAfter(statement, sql, resultSet);
}
}
@Override
protected void statementExecuteBefore(StatementProxy statement, String sql){
带九的诗句
printLog(statement, sql);
super.statementExecuteBefore(statement, sql);
}
@Override
protected void statementExecuteAfter(StatementProxy statement, String sql,boolean result){
super.statementExecuteAfter(statement, sql, result);
}
@Override
protected void statement_executeErrorAfter(StatementProxy statement, String sql, Throwable error){ super.statement_executeErrorAfter(statement, sql, error);
}
@Override
xp共享
protected void statementExecuteUpdateAfter(StatementProxy statement, String sql,int updateCount){ super.statementExecuteUpdateAfter(statement, sql, updateCount);
}
private void printLog(StatementProxy statement, String sql){
Integer parameterSize = ParametersSize();
鸿门宴译文
List<Object> parameters =new ArrayList<>(parameterSize);
for(int i =0; i < parameterSize;++i){
JdbcParameter jdbcParameter = Parameter(i);
parameters.Value());
}
String dbType = ConnectionProxy().getDirectDataSource().getDbType();
String formattedSql = SQLUtils.format(sql, dbType, parameters);
formattedSql = place("\n"," ")
.replace("\r"," ")
.replace("\t","");
log.info(formattedSql);
}
}

本文发布于:2023-07-23 03:36:47,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1092830.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:经理   菜谱   近义词   鸿门宴
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图