Mybatis_05/26

本文详细介绍了Mybatis的Resources类用于读取配置文件,SqlSessionFactoryBuilder用于构建工厂,以及SqlSessionFactory在项目中的角色。重点讲解了openSession()方法的不同用法和SqlSession的使用规范。还展示了如何利用工具类MybatisUtils简化操作,包括DAO层的实现和测试案例的运行结果。

主要类的介绍

1)Resources: mybatis中的一个类, 负责读取主配置文件
    InputStream in = Resources.getResourceAsStream("mybatis.xml");

2)SqlSessionFactoryBuilder : 创建SqlSessionFactory对象, 
     SqlSessionFactoryBuilder builder  = new SqlSessionFactoryBuilder();
     //创建SqlSessionFactory对象
     SqlSessionFactory factory = builder.build(in);
 3)SqlSessionFactory : 重量级对象, 程序创建一个对象耗时比较长,使用资源比较多。
    在整个项目中,有一个就够用了。
    SqlSessionFactory:接口,接口实现类: DefaultSqlSessionFactory
    SqlSessionFactory作用: 获取SqlSession对象。SqlSession sqlSession = factory.openSession();

 4) openSession()方法说明:
   1. openSession() :无参数的, 获取是非自动提交事务的SqlSession对象
   2. openSession(boolean): openSession(true)  获取自动提交事务的SqlSession. 
	                        openSession(false)  非自动提交事务的SqlSession对象
   3. SqlSession: 
        SqlSession接口 :定义了操作数据的方法 例如 selectOne() ,selectList()      ,insert(),update(), delete(), commit(), rollback()
        SqlSession接口的实现类DefaultSqlSession。

使用要求: SqlSession对象不是线程安全的,需要在方法内部使用, 在执行sql语句之前,使用openSession()获取SqlSession对象。
在执行完sql语句后,需要关闭它,执行SqlSession.close(). 这样能保证他的使用是线程安全的。

实现工具类

MybatisUtils:

package com.sdut.utils;

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 java.io.IOException;
import java.io.InputStream;

public class MybatisUtils {

    private static SqlSessionFactory factory = null;
    //静态块:读文件
    static {
        String config = "mybatis.xml";
        try {
            InputStream in = Resources.getResourceAsStream(config);
            //创建SqlSessionFactory对象
            factory = new SqlSessionFactoryBuilder().build(in);
            //
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    //获取SqlSession方法
    public static SqlSession getSqlSession() {
        SqlSession sqlSession = null;
        if(factory != null) {
            sqlSession = factory.openSession();   //非自动提交事务
        }
        return sqlSession;
    }
}

利用Dao层操作数据库

StudentDao:

package com.sdut.dao;

import com.sdut.entity.Student;

import java.util.List;

public interface StudentDao {
    //查询所有
    List<Student> selectAllStudents();
    //插入
    int insertStudent(Student student);
    //删除
    int deleteStudentById(int id);
}

StudentDao.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">

<mapper namespace="com.sdut.dao.StudentDao">
    <select id="selectAllStudents" resultType="com.sdut.entity.Student">
        select * from student order by id
    </select>
    <insert id="insertStudent">
        insert into student values(#{id}, #{name}, #{email}, #{age})
    </insert>
    <delete id="deleteStudentById">
        delete from student where id=#{id}
    </delete>
</mapper>

StudentDao接口实现类:

package com.sdut.dao.impl;

import com.sdut.dao.StudentDao;
import com.sdut.entity.Student;
import com.sdut.utils.MybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class StudentDaoImpl implements StudentDao {     //ctrl+o
    @Override
    public List<Student> selectAllStudents() {
        //获取SqlSession对象
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        String sqlId = "com.sdut.dao.StudentDao.selectAllStudents";
        List<Student> studentList = sqlSession.selectList(sqlId);
        sqlSession.close();
        return studentList;
    }

    @Override
    public int deleteStudentById(int id) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        String sqlId = "com.sdut.dao.StudentDao.deleteStudentById";
        int result = sqlSession.delete(sqlId, id);
        sqlSession.commit();
        sqlSession.close();
        return result;
    }

    @Override
    public int insertStudent(Student student) {
        SqlSession sqlSession = MybatisUtils.getSqlSession();
        String sqlId = "com.sdut.dao.StudentDao.insertStudent";
        int result = sqlSession.insert(sqlId, student);
        sqlSession.commit();
        sqlSession.close();
        return result;
    }
}

Test测试类:

package com.sdut;

import com.sdut.dao.StudentDao;
import com.sdut.dao.impl.StudentDaoImpl;
import com.sdut.entity.Student;
import org.junit.Test;

import java.util.List;

public class MybatisTest {
    @Test
    public void testselectAllStudents() {
        StudentDao studentDao = new StudentDaoImpl();
        List<Student> studentList = studentDao.selectAllStudents();
        for(Student stu : studentList) {
            System.out.println(stu);
        }
    }

    @Test
    public void testinsertStudent() {
        StudentDao studentDao = new StudentDaoImpl();

        Student student = new Student();
        student.setId(1004);
        student.setName("孙悟空");
        student.setEmail("huaguoshan.com");
        student.setAge(10000);

        int result = studentDao.insertStudent(student);
        System.out.println("结果为:" + result);
    }

    @Test
    public void testdeleteStudentById() {
        StudentDao studentDao = new StudentDaoImpl();
        int result = studentDao.deleteStudentById(1001);
        System.out.println("结果为:" + result);
    }
}

运行结果:

运行结果

2025-11-04 16:47:05.706 INFO 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器 : CHROME11 2025-11-04 16:47:05.706 INFO 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器版本 : 117.0.0.0 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.apps.logging.aspect.LoggingAspect : 方法规则式拦截: supplierAvg 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 请求Url : http://sbsfn.smecs.com:80/coa/chart/supplier 2025-11-04 16:47:05.713 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 请求ip : 10.190.84.235 2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器 : CHROME11 2025-11-04 16:47:05.714 INFO 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 浏览器版本 : 117.0.0.0 2025-11-04 16:47:11.740 ERROR 25365 --- [[ACTIVE] ExecuteThread: '22' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:11.741 ERROR 25365 --- [[ACTIVE] ExecuteThread: '25' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.g.a.c.c.e.Error500Controller : 捕获到错误: MyBatisSystemException: nested exception is org.apache.ibatis.executor.ExecutorException: Error selecting key or setting result to parameter object. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.388 ERROR 25365 --- [[ACTIVE] ExecuteThread: '56' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.417 ERROR 25365 --- [[ACTIVE] ExecuteThread: '4' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.427 ERROR 25365 --- [[ACTIVE] ExecuteThread: '99' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.511 ERROR 25365 --- [[ACTIVE] ExecuteThread: '63' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.521 ERROR 25365 --- [[ACTIVE] ExecuteThread: '36' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.547 ERROR 25365 --- [[ACTIVE] ExecuteThread: '7' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.553 ERROR 25365 --- [[ACTIVE] ExecuteThread: '74' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.559 ERROR 25365 --- [[ACTIVE] ExecuteThread: '67' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.561 ERROR 25365 --- [[ACTIVE] ExecuteThread: '66' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.582 ERROR 25365 --- [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.596 ERROR 25365 --- [[ACTIVE] ExecuteThread: '51' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.606 ERROR 25365 --- [[ACTIVE] ExecuteThread: '104' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.607 ERROR 25365 --- [[ACTIVE] ExecuteThread: '26' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.628 ERROR 25365 --- [[ACTIVE] ExecuteThread: '101' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. ### The error may exist in URL [zip:/home/weblogic/weblogic/user_projects/domains/smecs/servers/AdminServer/tmp/_WL_user/coa_1.0.0/svf14e/war/WEB-INF/lib/_wl_cls_gen.jar!/mybatis/mapper/CoaLotParameterMapper.xml] ### The error may involve com.smec.apps.coa.mapper.CoaLotParameterMapper.listLotParameterForDashboardStdDev ### The error occurred while executing a query ### Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is weblogic.jdbc.extensions.PoolLimitSQLException: weblogic.common.resourcepool.ResourceLimitException: No resources currently available in pool JDBC-ORACLE-COA to allocate to applications, please increase the size of the pool and retry.. 2025-11-04 16:47:16.633 ERROR 25365 --- [[ACTIVE] ExecuteThread: '59' for queue: 'weblogic.kernel.Default (self-tuning)'] c.o.group.apps.core.aop.ConsolePrintAop : 抛出异常 : nested exception is org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is we这是啥异常
最新发布
11-06
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值