Druid连接池与Mybatis-Plus非Spring环境整合:报错异常:NoClassDefFoundError

news2024/11/14 20:48:35

                    


最近在搞一个Netty与扫描枪通信项目;通过调研框架使用Mybatis-Plus+Druid作为获取数据库数据,结果整合报了个错,顺便记录下:

一,配置文件:

driverClassName=com.mysql.cj.jdbc.Driver
url=jdbc:mysql://127.0.0.1:3306/xxxxxxx?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false
username=zhangsan
password=123root
# max active connection size 最大连接数
maxActive=50
# initial connection Size 初始化连接数
initialSize=5
# min idle connecton size 最小连接数,如果一直没人使用,连接池连接最小保持在5,idle是空闲的意思
minIdle=1
# max wait time (5000 mil seconds)  等待队列最长等5秒
maxWait=60000
timeBetweenEvictionRunsMillis=30000
minEvictableIdleTimeMillis=300000
testWhileIdle=true
testOnBorrow=false
testOnReturn=false
filters=stat,wall

二:整合Mybatis-plus与Druid数据库连接池的工具类:


package org.jd.data.netty.big.window.chat.util;

import cn.hutool.core.date.StopWatch;
import com.alibaba.druid.pool.DruidDataSourceFactory;
import com.baomidou.mybatisplus.annotation.DbType;
import com.baomidou.mybatisplus.core.MybatisConfiguration;
import com.baomidou.mybatisplus.core.config.GlobalConfig;
import com.baomidou.mybatisplus.core.incrementer.DefaultIdentifierGenerator;
import com.baomidou.mybatisplus.core.injector.DefaultSqlInjector;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.toolkit.GlobalConfigUtils;
import com.baomidou.mybatisplus.extension.plugins.MybatisPlusInterceptor;
import com.baomidou.mybatisplus.extension.plugins.inner.PaginationInnerInterceptor;
import org.apache.ibatis.builder.xml.XMLMapperBuilder;
import org.apache.ibatis.logging.slf4j.Slf4jImpl;
import org.apache.ibatis.mapping.Environment;
import org.apache.ibatis.plugin.Interceptor;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
import org.apache.ibatis.transaction.jdbc.JdbcTransactionFactory;

import javax.sql.DataSource;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.JarURLConnection;
import java.net.URL;
import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;
import java.util.Enumeration;
import java.util.Objects;
import java.util.Properties;
import java.util.jar.JarEntry;
import java.util.jar.JarFile;

/**
 * try{}catch(){}finally{} 快捷键 ctrl+alt+t
 * 阿里巴巴开源数据库连接池(Druid)
 * 整合Mybatis-Plus工具类
 */
public class ProxyDruidPoolUtil {
    private static DataSource dataSource;
    private static final String PROTOCOL_XML = "file";
    private static final String ENTRY_XML_SUFFIX = ".xml";
    private static SqlSessionFactory sqlSessionFactory;
    // SqlSession是线程不安全的,sqlSession相当于JDBC的connection连接
    private static SqlSession session;

    private ProxyDruidPoolUtil() {
        System.out.println("被调用多少次");
    }

    private static class ProxyDruidPoolUtiHandler {
        private static ProxyDruidPoolUtil newInstance = new ProxyDruidPoolUtil();
    }

    public static ProxyDruidPoolUtil getInstance() {
        return ProxyDruidPoolUtiHandler.newInstance;
    }

    static {
        StopWatch stopWatch = StopWatch.create("Druid-Pool-Init-Task");
        stopWatch.start("Druid数据库连接池初始化");
        Properties properties = new Properties();
        try {
            URL url = ProxyDruidPoolUtil.class.getClassLoader().getResource("config/druid.properties");
            properties.load(new FileInputStream(url.getPath()));
            dataSource = DruidDataSourceFactory.createDataSource(properties);
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            stopWatch.stop();
       
            initSqlSessionFactoryBuilder();
            System.out.println(stopWatch.getLastTaskName() + " 耗时: " + stopWatch.getTotalTimeSeconds() + "秒 | "+properties.toString());
        }
    }

    /**
     * 解析mapper.xml文件
     *
     * @param configuration
     * @param classPath
     * @throws IOException
     */
    private static void registryMapperXml(MybatisConfiguration configuration, String classPath) {
        ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Enumeration<URL> mapper = contextClassLoader.getResources(classPath);
            while (mapper.hasMoreElements()) {
                URL url = mapper.nextElement();
                if (url.getProtocol().equals(PROTOCOL_XML)) {
                    String path = url.getPath();
                    File file = new File(path);
                    File[] files = file.listFiles();
                    for (File f : files) {
                        FileInputStream in = new FileInputStream(f);
                        XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(in, configuration, f.getPath(), configuration.getSqlFragments());
                        xmlMapperBuilder.parse();
                        in.close();
                    }
                } else {
                    JarURLConnection urlConnection = (JarURLConnection) url.openConnection();
                    JarFile jarFile = urlConnection.getJarFile();
                    Enumeration<JarEntry> entries = jarFile.entries();
                    while (entries.hasMoreElements()) {
                        JarEntry jarEntry = entries.nextElement();
                        if (jarEntry.getName().endsWith(ENTRY_XML_SUFFIX)) {
                            InputStream in = jarFile.getInputStream(jarEntry);
                            XMLMapperBuilder xmlMapperBuilder = new XMLMapperBuilder(in, configuration, jarEntry.getName(), configuration.getSqlFragments());
                            xmlMapperBuilder.parse();
                            in.close();
                        }
                    }
                }
            }
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    /**
     * 保证该方法初始化一次
     * @return
     */
    private static SqlSessionFactory initSqlSessionFactoryBuilder() {
        SqlSessionFactoryBuilder builder = new SqlSessionFactoryBuilder();
        //这是mybatis-plus的配置对象,对mybatis的Configuration进行增强
        MybatisConfiguration configuration = new MybatisConfiguration();
        //这是初始化配置,后面会添加这部分代码
        initConfiguration(configuration);
        //这是初始化连接器,如mybatis-plus的分页插件
        configuration.addInterceptor(initInterceptor());
        //配置日志实现
        configuration.setLogImpl(Slf4jImpl.class);
        //扫描mapper接口所在包
        configuration.addMappers("org.jd.data.netty.big.window.chat.frame.ui.room.mapper");
        //构建mybatis-plus需要的globalize
        GlobalConfig globalConfig = GlobalConfigUtils.getGlobalConfig(configuration);
        //此参数会自动生成实现baseMapper的基础方法映射
        globalConfig.setSqlInjector(new DefaultSqlInjector());
        //设置id生成器
        globalConfig.setIdentifierGenerator(new DefaultIdentifierGenerator());
        //设置超类mapper
        globalConfig.setSuperMapperClass(BaseMapper.class);
        //设置数据源
        Environment environment = new Environment("1", new JdbcTransactionFactory(), getDataSource());
        configuration.setEnvironment(environment);
        // classpath路径下面
        registryMapperXml(configuration, "room/mapper/");
        //构建sqlSessionFactory
        sqlSessionFactory = builder.build(configuration);
        return sqlSessionFactory;
    }

    /**
     * 初始化配置
     *
     * @param configuration
     */
    private static void initConfiguration(MybatisConfiguration configuration) {
        //开启驼峰大小写转换
        configuration.setMapUnderscoreToCamelCase(true);
        //配置添加数据自动返回数据主键
        configuration.setUseGeneratedKeys(true);
    }


    /**
     * mybatis-plus拦截器插件
     *
     * @return {@link Interceptor}
     */
    private static Interceptor initInterceptor() {
        //创建mybatis-plus插件对象
        MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
        //构建分页插件
        PaginationInnerInterceptor paginationInnerInterceptor = new PaginationInnerInterceptor();
        paginationInnerInterceptor.setDbType(DbType.MYSQL);
        paginationInnerInterceptor.setOverflow(true);
        // 每页允许最大500条
        paginationInnerInterceptor.setMaxLimit(500L);
        interceptor.addInnerInterceptor(paginationInnerInterceptor);
        return interceptor;
    }


    /**
     * 获取数据库连接
     * 初始化SqlSession会话,整个项目中有多个SqlSession会话,该回话的生命周期相对于JDBC中 
     * 的数据库连接Connection对象,资源宝贵,记得用完关闭;
     * @return {@link Connection}
     * @throws SQLException
     */
    public static Connection getConnection() throws SQLException {
        return session.getConnection();
    }

    /**
     * SqlSession多线程是线程不安全的
     * 获取SqlSession方法
     * @return
     */
    public static synchronized SqlSession getSession(){
        //创建session,设置自动提交
        session = sqlSessionFactory.openSession();
        return session;
    }



    /**
     * 获取数据库连接池对象
     *
     * @return {@link DataSource}
     */
    private static DataSource getDataSource() {
        return dataSource;
    }


    /**
     * 释放资源
     *
     * @param resultSet
     * @param statement
     * @param connection
     */
    public static void release(ResultSet resultSet, Statement statement, Connection connection) {
        if (Objects.nonNull(resultSet)) {
            try {
                resultSet.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        if (Objects.nonNull(statement)) {
            try {
                statement.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
        // 归还数据库连接,并不是真的关闭
        if (Objects.nonNull(connection)) {
            try {
                connection.close();
            } catch (SQLException e) {
                e.printStackTrace();
            }
        }
    }

    public static void release(SqlSession sqlSession){
        if(Objects.nonNull(sqlSession)){
            sqlSession.close();
        }
    }


}

第三,测试类及准备数据:获取指定数据库中的所有表

package org.jd.data.frame.big.window.service;

import org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil;
import org.junit.Test;

import java.sql.*;

public class SysRoomMapperTest {

    @Test
    public void saveSysRoom() throws SQLException {
        Connection connection =ProxyDruidPoolUtil.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement("show table status");
        ResultSet resultSet = preparedStatement.executeQuery();
        while(resultSet.next()){
            ResultSetMetaData metaData = resultSet.getMetaData();
            int columnCount = metaData.getColumnCount();
            for (int i = 1; i <= columnCount; i++) {
                String name = metaData.getColumnLabel(i);
                String field = resultSet.getString(i);
                String result= String.format("%s:%s\t",name,field);
                System.out.printf(result);
            }
            System.out.println();
        }

    }
}

异常信息结果:

java.lang.NoClassDefFoundError: org/springframework/core/GenericTypeResolver

	at com.baomidou.mybatisplus.core.toolkit.reflect.SpringReflectionHelper.resolveTypeArguments(SpringReflectionHelper.java:30)
	at com.baomidou.mybatisplus.core.toolkit.reflect.GenericTypeUtils.resolveTypeArguments(GenericTypeUtils.java:34)
	at com.baomidou.mybatisplus.core.toolkit.ReflectionKit.getSuperClassGenericType(ReflectionKit.java:97)
	at com.baomidou.mybatisplus.core.injector.AbstractSqlInjector.inspectInject(AbstractSqlInjector.java:43)
	at com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.parserInjector(MybatisMapperAnnotationBuilder.java:133)
	at com.baomidou.mybatisplus.core.MybatisMapperAnnotationBuilder.parse(MybatisMapperAnnotationBuilder.java:123)
	at com.baomidou.mybatisplus.core.MybatisMapperRegistry.addMapper(MybatisMapperRegistry.java:94)
	at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:106)
	at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:118)
	at com.baomidou.mybatisplus.core.MybatisConfiguration.addMappers(MybatisConfiguration.java:184)
	at org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil.initSqlSessionFactoryBuilder(ProxyDruidPoolUtil.java:137)
	at org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil.<clinit>(ProxyDruidPoolUtil.java:78)
	at org.jd.data.frame.big.window.service.SysRoomMapperTest.saveSysRoom(SysRoomMapperTest.java:12)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:59)
	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:56)
	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.BlockJUnit4ClassRunner$1.evaluate(BlockJUnit4ClassRunner.java:100)
	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:366)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:103)
	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:63)
	at org.junit.runners.ParentRunner$4.run(ParentRunner.java:331)
	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:79)
	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:329)
	at org.junit.runners.ParentRunner.access$100(ParentRunner.java:66)
	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:293)
	at org.junit.runners.ParentRunner$3.evaluate(ParentRunner.java:306)
	at org.junit.runners.ParentRunner.run(ParentRunner.java:413)
	at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
	at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:69)
	at com.intellij.rt.junit.IdeaTestRunner$Repeater.startRunnerWithArgs(IdeaTestRunner.java:33)
	at com.intellij.rt.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:220)
	at com.intellij.rt.junit.JUnitStarter.main(JUnitStarter.java:53)
Caused by: java.lang.ClassNotFoundException: org.springframework.core.GenericTypeResolver
	at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	... 38 more

 错误信息处于:

    at com.baomidou.mybatisplus.core.MybatisMapperRegistry.addMapper(MybatisMapperRegistry.java:94)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:106)
    at org.apache.ibatis.binding.MapperRegistry.addMappers(MapperRegistry.java:118)

去扫描mapper接口时,运用到了Spring中的:org/springframework/core/GenericTypeResolver

这个类,结果没引入Spring-Core核心jar,故抛出该异常:


解决方案:引入该三角坐标

<dependency>
    <groupId>org.springframework</groupId>
    <artifactId>spring-core</artifactId>
    <version>${项目依赖的jar版本}</version>
</dependency>


再次断点跟踪,已经可以扫描包下的所有mapper接口:

包:  org.jd.data.netty.big.window.chat.frame.ui.room.mapper

configuration.addMappers("org.jd.data.netty.big.window.chat.frame.ui.room.mapper");

四: 测试结果:


"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:53544,suspend=y,server=n -javaagent:C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\MybatisLog\lib\mybatis-agent-1.0.30-all.jar -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:C:\Users\Administrator\AppData\Local\JetBrains\IntelliJIdea2020.2\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -classpath "D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit5-rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\test-classes;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\classes;D:\maven_worker\Respository\Respository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;D:\maven_worker\Respository\Respository\cn\hutool\hutool-all\5.8.18\hutool-all-5.8.18.jar;D:\maven_worker\Respository\Respository\org\ehcache\ehcache\3.10.8\ehcache-3.10.8.jar;D:\maven_worker\Respository\Respository\javax\cache\cache-api\1.1.1\cache-api-1.1.1.jar;D:\maven_worker\Respository\Respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;D:\maven_worker\Respository\Respository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;D:\maven_worker\Respository\Respository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;D:\maven_worker\Respository\Respository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;D:\maven_worker\Respository\Respository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;D:\maven_worker\Respository\Respository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\maven_worker\Respository\Respository\org\jfree\jfreechart\1.5.4\jfreechart-1.5.4.jar;D:\maven_worker\Respository\Respository\mysql\mysql-connector-java\8.0.28\mysql-connector-java-8.0.28.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus\3.5.3.1\mybatis-plus-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-extension\3.5.3.1\mybatis-plus-extension-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-core\3.5.3.1\mybatis-plus-core-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-annotation\3.5.3.1\mybatis-plus-annotation-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\github\jsqlparser\jsqlparser\4.4\jsqlparser-4.4.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis\3.5.10\mybatis-3.5.10.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\maven_worker\Respository\Respository\com\alibaba\druid\1.2.16\druid-1.2.16.jar;D:\maven_worker\Respository\Respository\org\redisson\redisson\3.23.0\redisson-3.23.0.jar;D:\maven_worker\Respository\Respository\io\netty\netty-common\4.1.48.Final\netty-common-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec\4.1.48.Final\netty-codec-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-buffer\4.1.48.Final\netty-buffer-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-transport\4.1.48.Final\netty-transport-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver\4.1.48.Final\netty-resolver-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver-dns\4.1.48.Final\netty-resolver-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec-dns\4.1.48.Final\netty-codec-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-handler\4.1.48.Final\netty-handler-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\projectreactor\reactor-core\3.3.4.RELEASE\reactor-core-3.3.4.RELEASE.jar;D:\maven_worker\Respository\Respository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven_worker\Respository\Respository\io\reactivex\rxjava3\rxjava\3.1.6\rxjava-3.1.6.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling\2.0.11.Final\jboss-marshalling-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling-river\2.0.11.Final\jboss-marshalling-river-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\kryo\5.5.0\kryo-5.5.0.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\reflectasm\1.11.9\reflectasm-1.11.9.jar;D:\maven_worker\Respository\Respository\org\objenesis\objenesis\3.3\objenesis-3.3.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\minlog\1.3.1\minlog-1.3.1.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-annotations\2.10.3\jackson-annotations-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.3\jackson-dataformat-yaml-2.10.3.jar;D:\maven_worker\Respository\Respository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-core\2.10.3\jackson-core-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-databind\2.10.3\jackson-databind-2.10.3.jar;D:\maven_worker\Respository\Respository\net\bytebuddy\byte-buddy\1.10.8\byte-buddy-1.10.8.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-bean\5.1.6\jodd-bean-5.1.6.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-core\5.1.6\jodd-core-5.1.6.jar;D:\maven_worker\Respository\Respository\org\ini4j\ini4j\0.5.4\ini4j-0.5.4.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-core\5.2.5.RELEASE\spring-core-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-jcl\5.2.5.RELEASE\spring-jcl-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\junit\junit\4.13.2\junit-4.13.2.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.jd.data.frame.big.window.service.SysRoomMapperTest,saveSysRoom
Connected to the target VM, address: '127.0.0.1:53544', transport: 'socket'
Start: MyBatis Log EasyPlus
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
Druid数据库连接池初始化 耗时: 1.7827706秒 | {url=jdbc:mysql://127.0.0.1:3306/XXXXX?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false, filters=stat,wall, maxActive=50, driverClassName=com.mysql.cj.jdbc.Driver, maxWait=60000, testWhileIdle=true, minEvictableIdleTimeMillis=300000, testOnReturn=false, username=root, minIdle=1, timeBetweenEvictionRunsMillis=30000, password=123456, testOnBorrow=false, initialSize=5}
Name:sys_checkout	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:57:12	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:退房信息表	
Name:sys_customer_enter	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 15:37:48	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:旅客入住信息表	
Name:sys_customer_type	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 14:50:31	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:旅客类型表	
Name:sys_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户分组表	
Name:sys_hotel_member	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:null	Create_time:2023-07-23 00:04:28	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:会员信息表	
Name:sys_news	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:5303	Avg_row_length:4062	Data_length:21544960	Max_data_length:0	Index_length:0	Data_free:4194304	Auto_increment:5571	Create_time:2023-07-20 16:16:15	Update_time:null	Check_time:null	Collation:utf8_general_ci	Checksum:null	Create_options:	Comment:	
Name:sys_organization	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:组织机构表	
Name:sys_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:6	Avg_row_length:2730	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:7	Create_time:2023-07-11 23:59:18	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统功能权限表	
Name:sys_random_color	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 20:20:05	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:颜色表	
Name:sys_reserve_info	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:26:48	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:预订信息表	
Name:sys_role	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统角色表	
Name:sys_role_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 20:47:58	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:角色组表	
Name:sys_role_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:角色权限表	
Name:sys_room	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 15:50:39	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间信息表	
Name:sys_room_classify	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-22 23:11:12	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间类型关联表	
Name:sys_room_type	Engine:InnoDB	Version:10	Row_format:Dynamic	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-23 09:32:57	Update_time:null	Check_time:null	Collation:utf8mb4_general_ci	Checksum:null	Create_options:row_format=DYNAMIC	Comment:房间类型表	
Name:sys_user	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:16384	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:05	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:系统用户表	
Name:sys_user_group	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:07	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户和组关联表	
Name:sys_user_organization	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户机构表	
Name:sys_user_permission	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户权限表	
Name:sys_user_role	Engine:InnoDB	Version:10	Row_format:Compact	Rows:0	Avg_row_length:0	Data_length:16384	Max_data_length:0	Index_length:0	Data_free:0	Auto_increment:1	Create_time:2023-07-10 19:51:06	Update_time:null	Check_time:null	Collation:utf8mb4_0900_ai_ci	Checksum:null	Create_options:row_format=COMPACT	Comment:用户角色表	
Disconnected from the target VM, address: '127.0.0.1:53544', transport: 'socket'

Process finished with exit code 0

五:附测试相关类:


package org.jd.data.netty.big.window.chat.frame.ui.room.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.jd.data.netty.big.window.chat.entity.SysRoom;


/**
 * <p>
 * 房间信息表 Mapper 接口
 * </p>
 *
 * @author yh19166
 * @since 2023-07-23
 */
@Mapper
public interface SysRoomMapper extends BaseMapper<SysRoom> {

}

package org.jd.data.netty.big.window.chat.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.util.Date;
import java.util.Objects;

/**
 * <p>
 * 房间信息表
 * </p>
 *
 * @author yh19166
 * @since 2023-07-23
 */
@TableName("sys_room")
@Data
@NoArgsConstructor
public class SysRoom implements Serializable {

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 房间信息ID
     */
    @TableId(value = "room_id", type = IdType.AUTO)
    private Long roomId;

    /**
     * 房间类型ID
     */
    @TableField(value = "room_type_id")
    private Long roomTypeId;

    /**
     * 房间类型名称
     */
    private String roomTypeName;

    /**
     * 房间状态:0-已租 1未租
     */
    private Integer status;

    /**
     * 如: F3-502
     */
    private String location;

    /**
     * 010-5485625
     */
    private String roomTel;

    /**
     * 备注:
     */
    private String remark;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    /**
     * 逻辑删除:0--正常 1--删除
     */
    private Integer deleted;
    private Integer version;

    /**
     * 拓展字段1
     */
    private String otherExt1;


    /**
     * 拓展字段2
     */
    private String otherExt2;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof SysRoom)) return false;
        SysRoom sysRoom = (SysRoom) o;
        return Objects.equals(roomId, sysRoom.roomId) &&
                Objects.equals(roomTypeId, sysRoom.roomTypeId) &&
                Objects.equals(roomTypeName, sysRoom.roomTypeName) &&
                Objects.equals(status, sysRoom.status) &&
                Objects.equals(location, sysRoom.location) &&
                Objects.equals(roomTel, sysRoom.roomTel) &&
                Objects.equals(remark, sysRoom.remark) &&
                Objects.equals(createTime, sysRoom.createTime) &&
                Objects.equals(updateTime, sysRoom.updateTime) &&
                Objects.equals(deleted, sysRoom.deleted) &&
                Objects.equals(version, sysRoom.version) &&
                Objects.equals(otherExt1, sysRoom.otherExt1) &&
                Objects.equals(otherExt2, sysRoom.otherExt2);
    }

    @Override
    public int hashCode() {
        return Objects.hash(roomId, roomTypeId, roomTypeName, status, location, roomTel, remark, createTime, updateTime, deleted, version, otherExt1, otherExt2);
    }


    @Override
    public String toString() {
        return "SysRoom{" +
                ", roomId = " + roomId +
                ", roomTypeId = " + roomTypeId +
                ", roomTypeName = " + roomTypeName +
                ", status = " + status +
                ", location = " + location +
                ", roomTel = " + roomTel +
                ", remark = " + remark +
                ", createTime = " + createTime +
                ", updateTime = " + updateTime +
                ", deleted = " + deleted +
                ", version = " + version +
                ", otherExt1 = " + otherExt1 +
                ", otherExt2 = " + otherExt2 +
                "}";
    }
}

package org.jd.data.frame.big.window.service;

import org.apache.ibatis.session.SqlSession;
import org.jd.data.netty.big.window.chat.entity.SysRoom;
import org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomMapper;
import org.jd.data.netty.big.window.chat.util.ProxyDruidPoolUtil;
import org.junit.Test;

import java.sql.*;
import java.util.Date;

public class SysRoomMapperTest {

    @Test
    public void findAllTables() throws SQLException {
        Connection connection = ProxyDruidPoolUtil.getConnection();
        PreparedStatement preparedStatement = connection.prepareStatement("show table status");
        ResultSet resultSet = preparedStatement.executeQuery();
        while (resultSet.next()) {
            ResultSetMetaData metaData = resultSet.getMetaData();
            int columnCount = metaData.getColumnCount();
            for (int i = 1; i <= columnCount; i++) {
                String name = metaData.getColumnLabel(i);
                String field = resultSet.getString(i);
                String result = String.format("%s:%s\t", name, field);
                System.out.printf(result);
            }
            System.out.println();
        }
        // 释放资源
        ProxyDruidPoolUtil.release(null, null, connection);
    }

    @Test
    public void saveSysRoom() {
        SqlSession session = ProxyDruidPoolUtil.getSession();
        SysRoomMapper sysRoomMapper = session.getMapper(SysRoomMapper.class);
        SysRoom sysRoom = new SysRoom();
        sysRoom.setRoomTypeName("豪华标准间");
        sysRoom.setRoomTypeId(10002L);
        sysRoom.setDeleted(0);
        sysRoom.setLocation("北京市海淀区中国人民银行科技楼");
        sysRoom.setRoomId(20000022L);
        sysRoom.setRoomTel("010-5634586");
        sysRoom.setStatus(0);
        sysRoom.setRemark("双人套房豪华间");
        sysRoom.setCreateTime(new Date());
        sysRoom.setUpdateTime(new Date());
        sysRoomMapper.insert(sysRoom);
        // 手动提交
        session.commit();
        session.close();
    }
}

测试结果:

"C:\Program Files\Java\jdk1.8.0_221\bin\java.exe" -javaagent:C:\Users\Administrator\AppData\Roaming\JetBrains\IntelliJIdea2020.2\plugins\MybatisLog\lib\mybatis-agent-1.0.30-all.jar -ea -Didea.test.cyclic.buffer.size=1048576 "-javaagent:D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar=55040:D:\idea_worker\IntelliJ IDEA 2020.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\idea_worker\IntelliJ IDEA 2020.2\lib\idea_rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit5-rt.jar;D:\idea_worker\IntelliJ IDEA 2020.2\plugins\junit\lib\junit-rt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_221\jre\lib\rt.jar;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\test-classes;D:\program_file\SSO-ReactiveServer-Sysetem\SSO-JRootPaneWindow-provider\target\classes;D:\maven_worker\Respository\Respository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;D:\maven_worker\Respository\Respository\cn\hutool\hutool-all\5.8.18\hutool-all-5.8.18.jar;D:\maven_worker\Respository\Respository\org\ehcache\ehcache\3.10.8\ehcache-3.10.8.jar;D:\maven_worker\Respository\Respository\javax\cache\cache-api\1.1.1\cache-api-1.1.1.jar;D:\maven_worker\Respository\Respository\org\slf4j\slf4j-api\1.7.30\slf4j-api-1.7.30.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\jaxb-runtime\2.3.2\jaxb-runtime-2.3.2.jar;D:\maven_worker\Respository\Respository\jakarta\xml\bind\jakarta.xml.bind-api\2.3.3\jakarta.xml.bind-api-2.3.3.jar;D:\maven_worker\Respository\Respository\org\glassfish\jaxb\txw2\2.3.2\txw2-2.3.2.jar;D:\maven_worker\Respository\Respository\com\sun\istack\istack-commons-runtime\3.0.8\istack-commons-runtime-3.0.8.jar;D:\maven_worker\Respository\Respository\org\jvnet\staxex\stax-ex\1.8.1\stax-ex-1.8.1.jar;D:\maven_worker\Respository\Respository\com\sun\xml\fastinfoset\FastInfoset\1.2.16\FastInfoset-1.2.16.jar;D:\maven_worker\Respository\Respository\jakarta\activation\jakarta.activation-api\1.2.2\jakarta.activation-api-1.2.2.jar;D:\maven_worker\Respository\Respository\org\jfree\jfreechart\1.5.4\jfreechart-1.5.4.jar;D:\maven_worker\Respository\Respository\mysql\mysql-connector-java\8.0.28\mysql-connector-java-8.0.28.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus\3.5.3.1\mybatis-plus-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-extension\3.5.3.1\mybatis-plus-extension-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-core\3.5.3.1\mybatis-plus-core-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\baomidou\mybatis-plus-annotation\3.5.3.1\mybatis-plus-annotation-3.5.3.1.jar;D:\maven_worker\Respository\Respository\com\github\jsqlparser\jsqlparser\4.4\jsqlparser-4.4.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis\3.5.10\mybatis-3.5.10.jar;D:\maven_worker\Respository\Respository\org\mybatis\mybatis-spring\2.0.7\mybatis-spring-2.0.7.jar;D:\maven_worker\Respository\Respository\com\alibaba\druid\1.2.16\druid-1.2.16.jar;D:\maven_worker\Respository\Respository\org\redisson\redisson\3.23.0\redisson-3.23.0.jar;D:\maven_worker\Respository\Respository\io\netty\netty-common\4.1.48.Final\netty-common-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec\4.1.48.Final\netty-codec-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-buffer\4.1.48.Final\netty-buffer-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-transport\4.1.48.Final\netty-transport-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver\4.1.48.Final\netty-resolver-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-resolver-dns\4.1.48.Final\netty-resolver-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-codec-dns\4.1.48.Final\netty-codec-dns-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\netty\netty-handler\4.1.48.Final\netty-handler-4.1.48.Final.jar;D:\maven_worker\Respository\Respository\io\projectreactor\reactor-core\3.3.4.RELEASE\reactor-core-3.3.4.RELEASE.jar;D:\maven_worker\Respository\Respository\org\reactivestreams\reactive-streams\1.0.3\reactive-streams-1.0.3.jar;D:\maven_worker\Respository\Respository\io\reactivex\rxjava3\rxjava\3.1.6\rxjava-3.1.6.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling\2.0.11.Final\jboss-marshalling-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\org\jboss\marshalling\jboss-marshalling-river\2.0.11.Final\jboss-marshalling-river-2.0.11.Final.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\kryo\5.5.0\kryo-5.5.0.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\reflectasm\1.11.9\reflectasm-1.11.9.jar;D:\maven_worker\Respository\Respository\org\objenesis\objenesis\3.3\objenesis-3.3.jar;D:\maven_worker\Respository\Respository\com\esotericsoftware\minlog\1.3.1\minlog-1.3.1.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-annotations\2.10.3\jackson-annotations-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\dataformat\jackson-dataformat-yaml\2.10.3\jackson-dataformat-yaml-2.10.3.jar;D:\maven_worker\Respository\Respository\org\yaml\snakeyaml\1.25\snakeyaml-1.25.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-core\2.10.3\jackson-core-2.10.3.jar;D:\maven_worker\Respository\Respository\com\fasterxml\jackson\core\jackson-databind\2.10.3\jackson-databind-2.10.3.jar;D:\maven_worker\Respository\Respository\net\bytebuddy\byte-buddy\1.10.8\byte-buddy-1.10.8.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-bean\5.1.6\jodd-bean-5.1.6.jar;D:\maven_worker\Respository\Respository\org\jodd\jodd-core\5.1.6\jodd-core-5.1.6.jar;D:\maven_worker\Respository\Respository\org\ini4j\ini4j\0.5.4\ini4j-0.5.4.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-core\5.2.5.RELEASE\spring-core-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\org\springframework\spring-jcl\5.2.5.RELEASE\spring-jcl-5.2.5.RELEASE.jar;D:\maven_worker\Respository\Respository\junit\junit\4.13.2\junit-4.13.2.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest-core\2.1\hamcrest-core-2.1.jar;D:\maven_worker\Respository\Respository\org\hamcrest\hamcrest\2.1\hamcrest-2.1.jar" com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 org.jd.data.frame.big.window.service.SysRoomMapperTest,saveSysRoom
Start: MyBatis Log EasyPlus
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.

Druid数据库连接池初始化 耗时: 0.1241456秒 | {url=jdbc:mysql://127.0.0.1:3306/tope-pay-user?useUnicode=true&characterEncoding=UTF-8&useOldAliasMetadataBehavior=true&autoReconnect=true&failOverReadOnly=false&useSSL=false, filters=stat,wall, maxActive=50, driverClassName=com.mysql.cj.jdbc.Driver, maxWait=60000, testWhileIdle=true, minEvictableIdleTimeMillis=300000, testOnReturn=false, username=root, minIdle=1, timeBetweenEvictionRunsMillis=30000, password=123456, testOnBorrow=false, initialSize=5}
==>  SQLStructure: {"id":"org.jd.data.netty.big.window.chat.frame.ui.room.mapper.SysRoomMapper.insert","originalSql":"INSERT INTO sys_room  ( room_type_id,\nroom_type_name,\nstatus,\nlocation,\nroom_tel,\nremark,\ncreate_time,\nupdate_time,\ndeleted )  VALUES  ( #{roomTypeId},\n#{roomTypeName},\n#{status},\n#{location},\n#{roomTel},\n#{remark},\n#{createTime},\n#{updateTime},\n#{deleted} )","completeSql":"INSERT INTO sys_room ( room_type_id, room_type_name, status, location, room_tel, remark, create_time, update_time, deleted ) VALUES ( 10002, '豪华标准间', 0, '北京市海淀区中国人民银行科技楼', '010-5634586', '双人套房豪华间', '2023-07-24 16:01:54', '2023-07-24 16:01:54', 0 )","parameter":"[{\"roomTypeId\":\"10002\"},{\"roomTypeName\":\"'豪华标准间'\"},{\"status\":\"0\"},{\"location\":\"'北京市海淀区中国人民银行科技楼'\"},{\"roomTel\":\"'010-5634586'\"},{\"remark\":\"'双人套房豪华间'\"},{\"createTime\":\"'2023-07-24 16:01:54'\"},{\"updateTime\":\"'2023-07-24 16:01:54'\"},{\"deleted\":\"0\"}]"}

Process finished with exit code 0

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

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

相关文章

SQL编译优化原理

最近在团队的OLAP引擎上做了一些SQL编译优化的工作&#xff0c;整理到了语雀上&#xff0c;也顺便发在博客上了。SQL编译优化理论并不复杂&#xff0c;只需要掌握一些关系代数的基础就比较好理解&#xff1b;比较困难的在于reorder算法部分。 文章目录 基础概念关系代数等价 j…

面试 | 校招字符串相关高频算法题汇总【C++实现】

文章目录 1、反转字符串2、反转字符串||3、字符串最后一个单词的长度4、找字符串中第一个只出现一次的字符5、仅仅反转字母6、验证一个字符串是否是回文7、反转字符串中的单词【⭐】&#xff08;1&#xff09;移除给出字符串中的多余空格&#xff08;2&#xff09;反转整个字符…

Linux下安装VirtualBox虚拟机

1. 简介 VirtualBox是一款强大的x86和AMD64/Intel64虚拟化产品&#xff0c;适用于企业和家庭。VirtualBox不仅是为企业客户提供的一款功能丰富、高性能的产品&#xff0c;它也是根据GNU通用公共许可证(GPL)版本3条款作为开放源码软件免费提供的唯一专业解决方案。有关VirtualBo…

Modbus TCP使用例程

一、Modbus介绍 关于Modbus的介绍可参考前面的文章<modbus tcp协议介绍及分析>和<modbus rtu通信格式测试解析>这2篇文章。 二、Agile Modbus软件包介绍 Agile Modbus软件包的链接地址&#xff1a; https://gitee.com/RT-Thread-Mirror/agile_modbus Agile Modbus的…

Day46 算法记录| 动态规划 13(子序列)

这里写目录标题 300.最长递增子序列 674. 最长连续递增序列718. 最长重复子数组 300.最长递增子序列 视频解析&#xff1a; 第一层for循环遍历每一个元素&#xff0c; ------- 第二层for循环找到当前元素前面有几个小于该值的元素 结尾需要统计最多的个数 class Solution {pu…

如何有效地使用ChatGPT写小说讲故事?

​构思故事情节&#xff0c;虽有趣但耗时&#xff0c;容易陷入写作瓶颈。ChatGPT可提供灵感&#xff0c;帮你解决写作难题。要写出引人入胜的故事&#xff0c;关键在于抓住八个要素——主题、人物、视角、背景、情节、语气、冲突和解决办法。 直接给出故事模板&#xff0c;你可…

无线温湿度信息收集点模块的组成和工作状态及编程与组网建议

在传感技术与物联网的不断发展下&#xff0c;无线温湿度信息收集点模块作为一种重要的终端设备&#xff0c;被广泛应用于各个领域。本文将详细介绍该模块的组成和工作状态&#xff0c;并给出编程和组网的建议。 一、组成 该无线温湿度信息收集点模块由以下几个核心组成部分构成…

Banana Pi BPI-KVM – 基于 Rockchip RK3568 SoC 的 KVM over IP 解决方案

Banana Pi 已经开始开发基于 Rockchip RK3568 SoC 的 BPI-KVM 盒&#xff0c;但它不是迷你 PC&#xff0c;而是 KVM over IP 解决方案&#xff0c;旨在远程控制另一台计算机或设备&#xff0c;就像您在现场一样&#xff0c;例如能够打开和关闭连接的设备、访问 BIOS 等。 商业…

vagrant centos7 根目录扩容

目录 1 创建 centos7 虚拟机 2 扩容根目录 我知道的扩容方式有两种&#xff1a;1 直接扩容分区 &#xff1b;2 扩容逻辑卷。 我没找到为根目录设置到逻辑卷的方法&#xff0c;所以使用直接扩容分区。 1 创建 centos7 虚拟机&#xff0c; vagrant up vagrant ssh 查看磁盘…

Git-分支管理

文章目录 1.分支管理2.合并冲突3.合并模式4.补充 1.分支管理 Git分支管理是指在Git版本控制系统中&#xff0c;使用分支来管理项目的不同开发线路和并行开发的能力。通过分支&#xff0c;开发者可以在独立的环境中进行功能开发、bug修复等工作&#xff0c;而不会影响到主分支上…

文章详情页 - 评论功能的实现

目录 1. 准备工作 1.1 创建评论表 1.2 创建评论实体类 1.3 创建 mapper 层评论接口和对应的 xml 实现 1.4 准备评论的 service 层 1.5 准备评论的 controller 层 2. 总的初始化详情页 2.1 加载评论列表 2.1.1 实现前端代码 2.1.2 实现后端代码 2.2 查询当前登录用户的…

SFP6012A-ASEMI代理海矽美快恢复二极管参数、尺寸、规格

编辑&#xff1a;ll SFP6012A-ASEMI代理海矽美快恢复二极管参数、尺寸、规格 型号&#xff1a;SFP6012A 品牌&#xff1a;ASEMI 封装&#xff1a;TO-247AC 恢复时间&#xff1a;100ns 正向电流&#xff1a;60A 反向耐压&#xff1a;1200V 芯片大小&#xff1a;102MIL*2…

苍穹外卖day-04

苍穹外卖day-04 本项目学自黑马程序员的《苍穹外卖》项目&#xff0c;是瑞吉外卖的Plus版本 功能更多&#xff0c;更加丰富。 结合资料&#xff0c;和自己对学习过程中的一些看法和问题解决情况上传课件笔记 视频&#xff1a;https://www.bilibili.com/video/BV1TP411v7v6/?sp…

一、window安装vagrant

篇章一、window安装vagrant 前言 在日常的学习中&#xff0c;需要在Window中学习Linux相关的操作命令&#xff0c;在本地熟悉Linux服务器环境&#xff0c;因此需要在电脑中安装Vagrant虚拟机来管理所需安装的Linux系统&#xff08;也就是后续的Centos-7&#xff09;。 1、下…

无涯教程-jQuery - Bounce方法函数

弹跳效果可以与effect()方法一起使用。这会在垂直或水平方向多次反弹元素。 Bounce - 语法 selector.effect( "bounce", {arguments}, speed ); 这是所有参数的描述- direction - 效果的方向。可以是"上(up)"&#xff0c;"下(down)"&#xf…

Debian9离线安装docker

1. 前言 在服务器禁止外网访问的情况下&#xff0c;无法通过apt-get install安装docker&#xff0c;使得docker安装变得异常曲折 本地下载安装包&#xff0c;scp到服务器通过dpkg -i 手动安装&#xff0c;启动docker服务失败… … 各种坑&#xff0c;猛男也要落泪 &#x1f92…

基于IAP的嵌入式系统在线编程设计(学习)

摘要&#xff1a;为了实现嵌入式系统程序的在线升级&#xff0c;提出一种基于IAP在线编程的程序更新方法。 以STM32L431控制器为例&#xff0c;该方法对控制器的片内FLASH进行区域划分&#xff0c;分别存放引导程序、执行程序及待更新程序。 系统通过运行引导程序将待更新程序…

飞行动力学-第15节-part2-松杆中性点 之 基础点摘要

飞行动力学-第15节-part2-松杆中性点 之 基础点摘要 1. 松杆中性点2. 松浮角2. 杆力梯度3. 参考资料 1. 松杆中性点 stick fixed&#xff1a; N 0 N_0 N0​&#xff0c;握杆&#xff0c;升降舵固定stick free&#xff1a; N 0 ′ N_0 N0′​&#xff0c;松杆&#xff0c;升降舵…

linux -网络编程一网络基本概念和Socket编程

目录 1 网络基础概念 1.1 协议 1.2分层模型 1.3 数据通信过程 1.4 网络应用程序的设计模式 1.5 以太网帧格式 1.6网络名词术语解析(自行阅读扫盲) 2 SOCKET编程 2.1 socket编程预备知识 2.2 socket编程主要的API函数介绍 目标&#xff1a; 了解OSI七层、TCP/IP四层模…

论文浅尝 | 预训练Transformer用于跨领域知识图谱补全

笔记整理&#xff1a;汪俊杰&#xff0c;浙江大学硕士&#xff0c;研究方向为知识图谱 链接&#xff1a;https://arxiv.org/pdf/2303.15682.pdf 动机 传统的直推式(tranductive)或者归纳式(inductive)的知识图谱补全(KGC)模型都关注于域内(in-domain)数据&#xff0c;而比较少关…