赞
踩
mybatis的添加配置文件----mybatis-config.xml如下
- <?xml version="1.0" encoding="UTF-8" ?>
- <!DOCTYPE configuration
- PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
- "http://mybatis.org/dtd/mybatis-3-config.dtd">
- <configuration>
- <settings>
- <!-- 打印sql日志 -->
- <setting name="logImpl" value="STDOUT_LOGGING" />
- </settings>
- </configuration>
springboot的配置文件----appcation.yml中添加
- mybatis:
- configuration:
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
mybatis.configuration.log-impl= org.apache.ibatis.logging.stdout.StdOutImpl
springboot+mybatis整合中,可以将springboot的配置文件添加
- logging:
- level:
- com.lucifer.springboot.cache.mapper: debug
com.lucifer.springboot.cache.mapper是包名
springboot+mybatis-plus
- <dependency>
- <groupId>com.baomidou</groupId>
- <artifactId>mybatis-plus-boot-starter</artifactId>
- <version>3.3.1</version>
- </dependency>
application.yml
- mybatis-plus:
- configuration:
- log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
- JDBC Connection [HikariProxyConnection@1006460161 wrapping com.mysql.cj.jdbc.ConnectionImpl@37cccae8] will not be managed by Spring
- ==> Preparing: SELECT id,user_name,age FROM user WHERE (user_name = ?)
- ==> Parameters: 张三(String)
- <== Columns: id, user_name, age
- <== Row: 1, 张三, 18
- <== Total: 1
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。