当前位置:   article > 正文

Mybatis配置之请求数据库时打印SQL语句_mybatis打印sql语句配置

mybatis打印sql语句配置

SQLInterceptor.java

package com.guide.util;

import java.sql.Connection;

import java.util.Date;

import java.util.Properties;

import org.apache.ibatis.executor.statement.BaseStatementHandler;

import org.apache.ibatis.executor.statement.RoutingStatementHandler;

import org.apache.ibatis.executor.statement.StatementHandler;

import org.apache.ibatis.mapping.BoundSql;

import org.apache.ibatis.mapping.MappedStatement;

import org.apache.ibatis.plugin.Interceptor;

import org.apache.ibatis.plugin.Intercepts;

import org.apache.ibatis.plugin.Invocation;

import org.apache.ibatis.plugin.Plugin;

import org.apache.ibatis.plugin.Signature;

/**

  • 运行时SQL输出

*/

@Intercepts({ @Signature(type = StatementHandler.class, method = “prepare”, args = { Connection.class }) })

public class SQLInterceptor implements Int

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/码创造者/article/detail/940270
推荐阅读
相关标签
  

闽ICP备14008679号