package session;
import java.io.IOException;
import java.io.InputStream;
import org.apache.ibatis.io.Resources;
import org.apache.ibatis.session.SqlSession;
import org.apache.ibatis.session.SqlSessionFactory;
import org.apache.ibatis.session.SqlSessionFactoryBuilder;
public class MybatisUtil {
//factroy实例化过程是一个比较耗费资源的过程,
//保证有且仅有一个factory
private static SqlSessionFactory factory;
private static ThreadLocal<SqlSession> tl =new ThreadLocal<>()
Mybatis获取Session的过程
最新推荐文章于 2024-07-24 14:39:15 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)