@Autowired private SqlSession sqlSession; public Connection getConnection(){ Connection conn = null; try { conn = sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection(); loh.info("===This Connection isClosed ? "+conn.isClosed()); } catch (Exception e) { e.printStackTrace(); } return conn; }