Mybatis:快速搭建Mybatis(2)

news2024/11/24 0:07:56

快速搭建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之后,这个配置文件可以省略,所以大家操作时可以直接复制、粘贴。

  1. 核心配置文件主要用于配置连接数据库的环境以及MyBatis的全局配置信息
  2. 核心配置文件存放的位置是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日志功能

  1. 加入依赖
        <dependency>
            <groupId>log4j</groupId>
            <artifactId>log4j</artifactId>
            <version>1.2.17</version>
        </dependency>
  1. 加入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

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/46065.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

【JavaSE】String类型

目录 1. Java中为何要有 String 类&#xff1f; 2. String 类中的常用方法 2.1 String 类中的构造方法 2.2 String 类对象的比较 2.2.1 比较是否引用同一个对象 2.2.2 使用 equals 方法 2.2.3 compareTo 方法 2.3 字符串的查找 2.4 字符串与别的数据类型的转换 2.4.1 数值和字…

RationalDMIS 2022位置度评价,轮廓度评价时, 元素理论值变了,如何一劳永逸解决!

1,几何尺寸和公差符号 2.通用尺寸公差符号 3.位置度(Position) 位置度的被测要素有点、直线和平面,基准要素主要有直线和平面。给定位置度的被测要素相对于基准要素必须保持图样给定的正确位置关系,被测要素相对于基准要素的正确位置关系应由基准要素和理论正确尺寸来…

python mitmproxy +雷电模拟器 安装

第一步 安装mitmproxy 首先在安装好python 的情况下 pip install mitmproxy 第二步 电脑端安装证书 进入这个目录下 如果没有就重新mitmproxy 点击mitmproxy-ca.p12&#xff0c;在电脑端安装证书 点击下一页 点击下一页 不用管密码直接下一页 按照途中选择&…

基于Spring更简单的读取和存储对象

在spring的创建和使用这篇博客中有讲到关于Spring存储和读取Bean对象的操作,但是细心的朋友有没有发现那些操作没有想象中的简单呢?所以呀,我今天要给朋友分享的是更简单的存储和读取Bean对象的方法,快来看看吧~ 在Spring中想要更简单的存储和读取对象的核心就是使用注解,这就…

蓝牙学习四(广播)

1.简介 什么叫做广播&#xff0c;顾名思义就像广场上的大喇叭一样&#xff0c;不停的向外传输着信号。不同的是&#xff0c;大喇叭传输的是音频信号&#xff0c;而蓝牙传输的是射频信号。 BLE使用的是无线电波传递信息&#xff0c;就是将数据编码&#xff0c;调制到射频信号中发…

cmake使用

1. cmake概述及例子 CMake快速入门 cmake、qmake、cl之间关系 1.1 各种cmake cmake根据CMakeLists.txt生成makefile&#xff0c;make根据makefile行编译。 1.1.1 最简cmake&#xff1a;生成可执行程序&#xff08;一个文件&#xff09; #CMakeLists.txt cmake_minimum_req…

【正点原子FPGA连载】 第二十章 LCD触摸屏实验摘自【正点原子】DFZU2EG/4EV MPSoC 之FPGA开发指南V1.0

1&#xff09;实验平台&#xff1a;正点原子MPSoC开发板 2&#xff09;平台购买地址&#xff1a;https://detail.tmall.com/item.htm?id692450874670 3&#xff09;全套实验源码手册视频下载地址&#xff1a; http://www.openedv.com/thread-340252-1-1.html 第二十章 LCD触摸…

第十一章 建立语义化版本并提交组件库到NPM仓库

语义化版本是这样规定的。 版本格式&#xff1a;主版本号.次版本号.修订号&#xff08;MAJOR.MINOR.PATCH&#xff09;&#xff0c;版本号递增规则如下&#xff1a; 主版本号&#xff1a;当你做了不兼容的 API 修改&#xff1b;次版本号&#xff1a;当你做了向下兼容的功能性…

springboot+vue毕业生离校系统

目 录 摘 要 I 目 录 III 第1章 概述 1 1.1 研究背景 1 1.2 研究现状 1 1.3 研究内容 2 第二章 开发技术介绍 2 2.1 系统开发平台 2 2.2 平台开发相关技术 3 2.2.1 B/S架构 3 2.2.2 Java技术介绍 4 2.2.3 mysql数据库介绍 4 2.2.4 …

盘点程序员的花式赚外快的骚操作

2022世界杯比赛难得如期开幕了&#xff0c;卡塔尔王子的表情包想必大家已经看到眼晕。 我拿2200亿和你玩&#xff0c;你踢一个0&#xff1a;2过不过分啊~ 现实中的投资可不比卡塔尔王子的表情包失落更多&#xff0c;毕竟投资有风险入行需谨慎。 然而悲惨的事实是&#xff0c;…

[附源码]SSM计算机毕业设计新生入学计算机配号系统JAVA

项目运行 环境配置&#xff1a; Jdk1.8 Tomcat7.0 Mysql HBuilderX&#xff08;Webstorm也行&#xff09; Eclispe&#xff08;IntelliJ IDEA,Eclispe,MyEclispe,Sts都支持&#xff09;。 项目技术&#xff1a; SSM mybatis Maven Vue 等等组成&#xff0c;B/S模式 M…

企业若要实现预期广告推广效果,必须做好这六个步骤

在网络营销中&#xff0c;软文营销是一种最常用的营销手段。 我们知道&#xff0c;很多公司都是用软文进行广告推广。 然而&#xff0c;许多公司都觉得&#xff0c;软文营销并不是一件容易的事情&#xff0c;因为它不仅要有高品质的内容&#xff0c;还要有一定的操作能力&#…

CAD最常用的快捷键大全来啦

CAD快捷键的使用能够让我们加快画图的速度&#xff0c;但是想想CAD中有那么多的功能命令&#xff0c;所以CAD快捷键是很多的&#xff0c;想要完全记住是不可能的&#xff0c;这里就总结了常用的CAD快捷键命令&#xff0c;可能不全但是很实用。 一、常用绘图快捷键 最基本的一…

低代码与mes生产管理系统:功能篇

随着信息技术的发展和应用,信息系统在企业中的使用也越来越广泛。不仅可以使企业内部和企业间的信息流通更为便捷和频繁&#xff0c;同时可以提高管理的水平&#xff0c;有助于提高企业的生产效益。其中mes生产管理系统就是美豳的调查资询公司AMR(Advanced Manufacturing Resea…

牛顿法,高斯牛顿法,列文伯格-马夸尔特(LM)法

文章目录一&#xff1a;牛顿法 &#xff08;Newtons method&#xff09;1&#xff1a;概述2&#xff1a;牛顿方向与牛顿法3&#xff1a;牛顿法的基本步骤4&#xff1a;举例二&#xff1a;高斯牛顿法 &#xff08;Gauss–Newton algorithm&#xff09;1&#xff1a;概述2&#x…

若依、多选框前后端处理,MyBatis处理多对多关系

背景 很经典的CRUD&#xff0c;整理下笔记。 后端 实体类 /*** 专业方向主键&#xff0c;用于下拉框搜索*/private Long disasterTypeId;/*** 专业方向*/private List<DisasterType> disasterType;业务层 /*** 新增专家信息库** param expertInfo 专家信息库* return 结…

mac pro M1(ARM)安装:php开发环境

0. 引言 最近在处理各个语言的加密算法&#xff0c;正好需要安装php环境&#xff0c;特此记录&#xff0c;以供后续参考 1. 安装php 1、安装php包管理工具composer brew install composer2、安装php brew install php # 同时可以指定版本安装 brew install php8.0 # 查…

基于Java+SpringBoot+Mybatis+Vue+ElementUi的航空公司电子售票系统

项目介绍 本系统是利用Spring Boot框架而设计的一款结合用户的实际情况而设计的平台&#xff0c;前端利用VUE技术开发&#xff0c;将可供教师和管理员来使用的所有界面来显示出来&#xff0c;利用Java语言技术来编程实现用户和管理员所执行的各类操作业务逻辑&#xff0c;以My…

在MacOS上实现两个网络调试助手的UDP通信测试

文章目录一、背景二、网络调试助手软件三、UDP通信过程一、背景 因为有一个项目要中会使用本机中两个应用程序之间的UDP通信。 因此本文记录一下怎么在MacOS上实现两个网络调试助手的UDP通信测试。 二、网络调试助手软件 我使用的网络调试助手软件是&#xff1a;网络调试助…

Revit 中参数化多边形的画法?

Revit 中参数化多边形的画法 问题提出 :在 Revit 中&#xff0c;系统画多边形的命合都无法参数化&#xff0c;网上有“六边形”参数化的画法教学 ( 这个教学被收入《每日一技》第 76期“Revit 中族编辑时可控六边形的画法详解”)&#xff0c;却对任意多边形无可奈何。 网上及前…