1、加载配置文件
InputStream is = Resources.getResourceAsStream("mybatis-config.xml");
2、获得session对象,接受结果
SqlSessionfactoryBuilder builder = new SqlSessionfactoryBuilder();
SqlSessionFactory factory = builder .build(is);
SqlSession session = factory.openSession();
List<Dept> list = session .selectList("selectAllDept")