快速搭建Mybatis
- 搭建Mybatis
- 目录框架
- 步骤一:创建Maven工程
- 步骤二:创建mybatis的核心配置文件
- 步骤三:创建mapper接口
- 步骤四:创建Mybatis的映射文件
- 步骤四:通过junit测试增删改查功能
- 步骤五:加入logback日志功能
- 进行测试
搭建Mybatis
目录框架
步骤一:创建Maven工程
在pom.xml中引入依赖
<dependencies>
<!-- Mybatis核心 -->
<dependency>
<groupId>org.mybatis</groupId>
<artifactId>mybatis</artifactId>
<version>3.5.7</version>
</dependency>
<!-- junit测试 -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<!-- MySQL驱动 -->
<dependency>
<groupId>mysql</groupId>
<artifactId>mysql-connector-java</artifactId>
<version>5.1.3</version>
</dependency>
</dependencies>
步骤二:创建mybatis的核心配置文件
习惯上命名为mybatis-config.xml
,这个文件名仅仅只是建议,并非强制要求。将来整合Spring之后,这个配置文件可以省略,所以大家操作时可以直接复制、粘贴。
- 核心配置文件主要用于配置连接数据库的环境以及MyBatis的全局配置信息
- 核心配置文件存放的位置是src/main/resources目录下
<?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>
<!--设置连接数据库的环境-->
<environments default="development">
<environment id="development">
<transactionManager type="JDBC"/>
<dataSource type="POOLED">
<property name="driver" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/mybatis?useSSL=false&useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8"/>
<property name="username" value="root"/>
<property name="password" value="1234"/>
</dataSource>
</environment>
</environments>
<!--引入映射文件-->
<mappers>
<mapper resource="mappers/UserMapper.xml"/>
</mappers>
</configuration>
步骤三:创建mapper接口
MyBatis中的mapper接口相当于以前的dao。但是区别在于,mapper仅仅是接口,我们不需要提供实现类
package com.atguigu.mapper;
import com.atguigu.pojo.User;
import java.util.List;
/**
* @Author Mr.Lu
* @Date 2022/11/26 16:45
* @ClassName UserMapper
* @Version 1.0
* 相当于dao层,数据库表为t_user,那么实体类就是User,
* 对应的dao层或者mapper层为UserDao或者UserMapper
*/
public interface UserMapper {
/**
* MyBatis面向接口编程的两个一致:
* 1、映射文件(xxxMapper.xml)的namespace要和mapper层(dao层)接口的全类名保持一致;
* 2、映射文件(xxxMapper.xml)中SQL语句的id要和mapper层接口中的方法名一致;
* @return
*/
/**
* 添加用户的信息
* @return
*/
int insertUser();
/**
* 更新用户信息
* @param id
* @return
*/
int updateUser(int id);
/**
* 根据id删除用户信息
* @param id
* @return
*/
int deleteUser(int id);
/**
* 根据id查询用户数据
* @param id
* @return
*/
User selectById(int id);
/**
* 查询数据库所有信息
* @return
*/
List<User> selectAll();
}
步骤四:创建Mybatis的映射文件
- 相关概念:ORM(Object Relationship Mapping)对象关系映射。
- 对象:Java的实体类对象
- 关系:关系型数据库
- 映射:二者之间的对应关系
Java概念 | 数据库概念 |
---|---|
类 | 表 |
属性 | 字段/列 |
对象 | 记录/行 |
- 映射文件的命名规则
- 表所对应的实体类的类名+Mapper.xml
- 例如:表t_user,映射的实体类为User,所对应的映射文件为UserMapper.xml
- 因此一个映射文件对应一个实体类,对应一张表的操作
- MyBatis映射文件用于编写SQL,访问以及操作表中的数据
- MyBatis映射文件存放的位置是src/main/resources/mappers目录下
- MyBatis中可以面向接口操作数据,要保证两个一致
- mapper接口的全类名和映射文件的命名空间(namespace)保持一致
- mapper接口中方法的方法名和映射文件中编写SQL的标签的id属性保持一致
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"https://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.atguigu.mapper.UserMapper">
<!-- int insertUser() -->
<insert id="insertUser">
insert into t_user values(null, 'lsm', '1234', 20, '男', '3108763627@.com')
</insert>
<!-- int updateUser(int id) -->
<update id="updateUser">
update t_user set username = 'lsm_yxy', age = 30, email = '123456678@.com' where id = 5
</update>
<!-- int deleteUser(int id) -->
<update id="deleteUser">
delete from t_user where id = 10
</update>
<!--
1. 查询的标签select必须设置属性resultType或resultMap,用于设置实体类和数据库表的映射关系
- resultType:自动映射,用于 ====属性名和表中字段名一致===== 的情况
- resultMap:自定义映射,用于 ====一对多或多对一或字段名和属性名不一致===== 的情况
2. 当查询的数据为多条时,不能使用实体类作为返回值,只能使用集合,否则会抛出异常TooManyResultsException;
但是若查询的数据只有一条,可以使用实体类或集合作为返回值-->
<select id="selectById" resultType="com.atguigu.pojo.User">
select * from t_user where id = 5;
</select>
<!-- 已经在mybatis-config.xml中的typeAliases标签内起别名 com.atguigu.pojo.User == User-->
<select id="selectAll" resultType="com.atguigu.pojo.User">
select * from t_user;
</select>
</mapper>
步骤四:通过junit测试增删改查功能
- SqlSession:代表Java程序和数据库之间的会话。(HttpSession是Java程序和浏览器之间的会话)
- SqlSessionFactory:是“生产”SqlSession的“工厂”
- 工厂模式:如果创建某一个对象,使用的过程基本固定,那么我们就可以把创建这个对象的相关代码封装到一个“工厂类”中,以后都使用这个工厂类来“生产”我们需要的对象
package com.atguigu.test;
import com.atguigu.mapper.UserMapper;
import com.atguigu.pojo.User;
import com.atguigu.util.GetSqlSession;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.junit.Test;
import java.io.IOException;
import java.io.InputStream;
import java.util.List;
/**
* @Author Mr.Lu
* @Date 2022/11/26 20:06
* @ClassName MybatisTest
* @Version 1.0
*/
public class MybatisTest {
@Test
public void testMybatis() throws IOException {
// 加载核心配置文件
InputStream inputStream = Resources.getResourceAsStream("mybatis-config.xml");
// 通过工厂建造对象SqlSessionFactoryBuilder获取sqlSessionFactory
SqlSessionFactory sqlSessionFactory =
new SqlSessionFactoryBuilder().build(inputStream);
// 获取sqlSession,此时通过SqlSession对象所操作的sql都必须手动提交或回滚事务,要不然提交失败,数据库不会发生变化
// SqlSession sqlSession = sqlSessionFactory.openSession();
// 创建SqlSession对象,此时通过SqlSession对象所操作的sql都会自动提交
SqlSession sqlSession = sqlSessionFactory.openSession(true);
// 通过代理模式创建UserMapper接口的代理实现类对象
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
// 调用UserMapper接口中的方法,就可以根据UserMapper的全类名匹配元素文件,
// 通过调用的方法名匹配映射文件中的SQL标签,并执行标签中的SQL语句
// 插入语句
// int count = userMapper.insertUser();
// 更新语句
// int count = userMapper.updateUser(5);
// 删除语句
// int count = userMapper.deleteUser(6);
// 根据id查询用户信息
// User user = userMapper.selectById(5);
// System.out.println(user);
// 查询所有
List<User> users = userMapper.selectAll();
for(User user : users){
System.out.println(user);
}
// 提交事务,与上面一一对应,如果设置为true,则下面这一行不需要
// sqlSession.commit();
// 关闭
sqlSession.close();
}
@Test
public void testInsertUser() throws IOException {
System.out.println("测试插入函数.................");
SqlSession sqlSession = GetSqlSession.getSqlSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
int count = userMapper.insertUser();
System.out.println(count);
sqlSession.close();
}
@Test
public void testUpdateUser() throws IOException {
System.out.println("测试更新函数.................");
SqlSession sqlSession = GetSqlSession.getSqlSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
int count = userMapper.updateUser(5);
System.out.println(count);
sqlSession.close();
}
@Test
public void testDeleteUser() throws IOException {
System.out.println("测试删除函数.................");
SqlSession sqlSession = GetSqlSession.getSqlSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
int count = userMapper.deleteUser(10);
System.out.println(count);
sqlSession.close();
}
@Test
public void testSelectById() throws IOException {
System.out.println("测试查询函数.................");
SqlSession sqlSession = GetSqlSession.getSqlSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
User user = userMapper.selectById(5);
System.out.println(user);
sqlSession.close();
}
@Test
public void testSelectAll() throws IOException {
System.out.println("测试查询所有函数.................");
SqlSession sqlSession = GetSqlSession.getSqlSession();
UserMapper userMapper = sqlSession.getMapper(UserMapper.class);
List<User> users = userMapper.selectAll();
for(User user : users){
System.out.println(user);
}
sqlSession.close();
}
}
- 此时需要手动提交事务,如果要自动提交事务,则在获取sqlSession对象时,使用
SqlSession sqlSession = sqlSessionFactory.openSession(true);
,传入一个Boolean类型的参数,值为true,这样就可以自动提交
步骤五:加入logback日志功能
- 加入依赖
<dependency>
<groupId>log4j</groupId>
<artifactId>log4j</artifactId>
<version>1.2.17</version>
</dependency>
- 加入logback.xml
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!--
CONSOLE(console控制台) :表示当前的日志信息是可以输出到控制台的。
-->
<appender name="CONSOLE" class="ch.qos.logback.core.ConsoleAppender">
<!--输出流对象 默认 System.out 改为 System.err(打印红色)-->
<target>System.err</target>
<encoder>
<!--格式化输出:
%d%d{yyyy-MM-dd HH:mm:ss.SSS}:表示日期(2022-04-15 13:37:38.600)
%-5level:级别从左显示5个字符宽度([INFO ], [TRACE])
%c: 类名(Test.class)
%thread:表示线程名([main])
%msg:日志消息;
%n: 是换行符
-->
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%-5level] %c [%thread] : %msg%n</pattern>
</encoder>
</appender>
<!--
appender中的name命名设置打印在那里(name = "FILE"是打印在文件中, name = "CONSOLE"是打印在控制台中)
File(文件):是输出的方向通向文件的
-->
<appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">
<encoder>
<pattern>%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>
<charset>utf-8</charset>
</encoder>
<!--日志输出路径-->
<file>E:/code/itheima-data.log</file>
<!--指定日志文件拆分和压缩规则-->
<rollingPolicy
class="ch.qos.logback.core.rolling.SizeAndTimeBasedRollingPolicy">
<!--通过指定压缩文件名称,来确定分割文件方式-->
<fileNamePattern>E:/code/itheima-data2-%d{yyyy-MM-dd}.log%i.rar</fileNamePattern>
<!--文件拆分大小-->
<maxFileSize>1MB</maxFileSize>
</rollingPolicy>
</appender>
<!--
level:用来设置打印级别,大小写无关:TRACE < DEBUG < INFO < WARN < ERROR | ALL(打印所有的日志) 和 OFF(关闭,不打印日志)
, 默认debug
<root>可以包含零个或多个<appender-ref>元素,标识这个输出位置将会被本日志级别控制。
-->
<root level="DEBUG">
<appender-ref ref="CONSOLE"/> <!-- 关联:可以在控制台进行输出,如果没有这一项,不会在控制台输出-->
<appender-ref ref="FILE"/>
</root>
</configuration>
进行测试
E:\IDEA_includeJDK\jdk1.8.0_25\bin\java.exe -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:F:\IDEA\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar=2823:F:\IDEA\IntelliJ IDEA 2021.1.1\bin" -Dfile.encoding=UTF-8 -classpath "F:\IDEA\IntelliJ IDEA 2021.1.1\lib\idea_rt.jar;F:\IDEA\IntelliJ IDEA 2021.1.1\plugins\junit\lib\junit5-rt.jar;F:\IDEA\IntelliJ IDEA 2021.1.1\plugins\junit\lib\junit-rt.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\charsets.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\deploy.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\access-bridge-64.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\cldrdata.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\dnsns.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\jaccess.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\jfxrt.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\localedata.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\nashorn.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\sunec.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\sunjce_provider.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\sunmscapi.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\sunpkcs11.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\ext\zipfs.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\javaws.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\jce.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\jfr.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\jfxswt.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\jsse.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\management-agent.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\plugin.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\resources.jar;E:\IDEA_includeJDK\jdk1.8.0_25\jre\lib\rt.jar;D:\mybatisProject\mybaits_01_quickstart\target\test-classes;D:\mybatisProject\mybaits_01_quickstart\target\classes;D:\apache-maven-3.6.1\mvn_resp\log4j\log4j\1.2.17\log4j-1.2.17.jar;D:\apache-maven-3.6.1\mvn_resp\ch\qos\logback\logback-classic\1.2.11\logback-classic-1.2.11.jar;D:\apache-maven-3.6.1\mvn_resp\ch\qos\logback\logback-core\1.2.11\logback-core-1.2.11.jar;D:\apache-maven-3.6.1\mvn_resp\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;D:\apache-maven-3.6.1\mvn_resp\org\mybatis\mybatis\3.5.6\mybatis-3.5.6.jar;D:\apache-maven-3.6.1\mvn_resp\junit\junit\4.12\junit-4.12.jar;D:\apache-maven-3.6.1\mvn_resp\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;D:\apache-maven-3.6.1\mvn_resp\mysql\mysql-connector-java\8.0.20\mysql-connector-java-8.0.20.jar;D:\apache-maven-3.6.1\mvn_resp\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.atguigu.test.MybatisTest
测试查询所有函数.................
2022-11-29 15:28:09.117 [DEBUG] org.apache.ibatis.logging.LogFactory [main] : Logging initialized using 'class org.apache.ibatis.logging.slf4j.Slf4jImpl' adapter.
2022-11-29 15:28:09.127 [DEBUG] org.apache.ibatis.io.VFS [main] : Class not found: org.jboss.vfs.VFS
2022-11-29 15:28:09.127 [DEBUG] org.apache.ibatis.io.JBoss6VFS [main] : JBoss 6 VFS API is not available in this environment.
2022-11-29 15:28:09.127 [DEBUG] org.apache.ibatis.io.VFS [main] : Class not found: org.jboss.vfs.VirtualFile
2022-11-29 15:28:09.132 [DEBUG] org.apache.ibatis.io.VFS [main] : VFS implementation org.apache.ibatis.io.JBoss6VFS is not valid in this environment.
2022-11-29 15:28:09.132 [DEBUG] org.apache.ibatis.io.VFS [main] : Using VFS adapter org.apache.ibatis.io.DefaultVFS
2022-11-29 15:28:09.132 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.132 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.182 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.182 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.182 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.182 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.182 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.187 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.236 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.236 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.236 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.236 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.241 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.241 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.247 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.353 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.561 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 195228908.
2022-11-29 15:28:09.566 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : ==> Preparing: select * from t_user;
2022-11-29 15:28:09.606 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : ==> Parameters:
2022-11-29 15:28:09.636 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : <== Total: 11
User{id=5, username='lsm_yxy', password='123456', age=30, sex='女', email='123456678@.com'}
User{id=7, username='lsm1', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=8, username='lsm2', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=9, username='lsm3', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=11, username='lsm4', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=12, username='lsm5', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=13, username='lsm6', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=14, username='lsm7', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=15, username='tom', password='root', age=10, sex='男', email='123456@.com'}
User{id=16, username='Tom', password='root', age=10, sex='男', email='123456@.com'}
User{id=17, username='lsm', password='1234', age=20, sex='男', email='3108763627@.com'}
2022-11-29 15:28:09.646 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@ba2f4ec]
2022-11-29 15:28:09.646 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 195228908 to pool.
测试更新函数.................
2022-11-29 15:28:09.646 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.646 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.657 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.666 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.666 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.666 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.666 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.682 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.687 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 954702563.
2022-11-29 15:28:09.687 [DEBUG] com.atguigu.mapper.UserMapper.updateUser [main] : ==> Preparing: update t_user set username = 'lsm_yxy', age = 30, email = '123456678@.com' where id = 5
2022-11-29 15:28:09.687 [DEBUG] com.atguigu.mapper.UserMapper.updateUser [main] : ==> Parameters:
2022-11-29 15:28:09.697 [DEBUG] com.atguigu.mapper.UserMapper.updateUser [main] : <== Updates: 1
1
2022-11-29 15:28:09.702 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@38e79ae3]
2022-11-29 15:28:09.702 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 954702563 to pool.
测试插入函数.................
2022-11-29 15:28:09.707 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.712 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.717 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.717 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.717 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.717 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.718 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.731 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.736 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 365590665.
2022-11-29 15:28:09.736 [DEBUG] com.atguigu.mapper.UserMapper.insertUser [main] : ==> Preparing: insert into t_user values(null, 'lsm', '1234', 20, '男', '3108763627@.com')
2022-11-29 15:28:09.736 [DEBUG] com.atguigu.mapper.UserMapper.insertUser [main] : ==> Parameters:
2022-11-29 15:28:09.747 [DEBUG] com.atguigu.mapper.UserMapper.insertUser [main] : <== Updates: 1
1
2022-11-29 15:28:09.747 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@15ca7889]
2022-11-29 15:28:09.747 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 365590665 to pool.
测试测试函数.................
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.757 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.766 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.776 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.787 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 793138072.
2022-11-29 15:28:09.787 [DEBUG] com.atguigu.mapper.UserMapper.deleteUser [main] : ==> Preparing: delete from t_user where id = 10
2022-11-29 15:28:09.787 [DEBUG] com.atguigu.mapper.UserMapper.deleteUser [main] : ==> Parameters:
2022-11-29 15:28:09.792 [DEBUG] com.atguigu.mapper.UserMapper.deleteUser [main] : <== Updates: 0
0
2022-11-29 15:28:09.792 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@2f465398]
2022-11-29 15:28:09.792 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 793138072 to pool.
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.802 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.807 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.807 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.807 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.807 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.818 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.818 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.822 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.837 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [Finalizer] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.837 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [Finalizer] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.837 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [Finalizer] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.837 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [Finalizer] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.837 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.846 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 555273695.
2022-11-29 15:28:09.851 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : ==> Preparing: select * from t_user;
2022-11-29 15:28:09.851 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : ==> Parameters:
2022-11-29 15:28:09.861 [DEBUG] com.atguigu.mapper.UserMapper.selectAll [main] : <== Total: 12
User{id=5, username='lsm_yxy', password='123456', age=30, sex='女', email='123456678@.com'}
User{id=7, username='lsm1', password='1234', age=20, sex='男', email='3108763627@.com'}
2022-11-29 15:28:09.861 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@2118cddf]
User{id=8, username='lsm2', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=9, username='lsm3', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=11, username='lsm4', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=12, username='lsm5', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=13, username='lsm6', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=14, username='lsm7', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=15, username='tom', password='root', age=10, sex='男', email='123456@.com'}
User{id=16, username='Tom', password='root', age=10, sex='男', email='123456@.com'}
User{id=17, username='lsm', password='1234', age=20, sex='男', email='3108763627@.com'}
User{id=18, username='lsm', password='1234', age=20, sex='男', email='3108763627@.com'}
2022-11-29 15:28:09.861 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 555273695 to pool.
测试查询函数.................
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: User.class
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/pojo/User.class
2022-11-29 15:28:09.872 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4 Q
2022-11-29 15:28:09.877 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.pojo.User matches criteria [is assignable to Object]
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : PooledDataSource forcefully closed/removed all connections.
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.class
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: UserMapper.xml
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Listing file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.class
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: ���� 4
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Find JAR URL: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Not a JAR: file:/D:/mybatisProject/mybaits_01_quickstart/target/classes/com/atguigu/mapper/UserMapper.xml
2022-11-29 15:28:09.882 [DEBUG] org.apache.ibatis.io.DefaultVFS [main] : Reader entry: <?xml version="1.0" encoding="UTF-8" ?>
2022-11-29 15:28:09.887 [DEBUG] org.apache.ibatis.io.ResolverUtil [main] : Checking to see if class com.atguigu.mapper.UserMapper matches criteria [is assignable to Object]
2022-11-29 15:28:09.897 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Opening JDBC Connection
2022-11-29 15:28:09.902 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Created connection 938545229.
2022-11-29 15:28:09.902 [DEBUG] com.atguigu.mapper.UserMapper.selectById [main] : ==> Preparing: select * from t_user where id = 5;
2022-11-29 15:28:09.902 [DEBUG] com.atguigu.mapper.UserMapper.selectById [main] : ==> Parameters:
2022-11-29 15:28:09.907 [DEBUG] com.atguigu.mapper.UserMapper.selectById [main] : <== Total: 1
User{id=5, username='lsm_yxy', password='123456', age=30, sex='女', email='123456678@.com'}
2022-11-29 15:28:09.907 [DEBUG] org.apache.ibatis.transaction.jdbc.JdbcTransaction [main] : Closing JDBC Connection [com.mysql.cj.jdbc.ConnectionImpl@37f1104d]
2022-11-29 15:28:09.907 [DEBUG] org.apache.ibatis.datasource.pooled.PooledDataSource [main] : Returned connection 938545229 to pool.
Process finished with exit code 0