大學生就業(yè)培訓,高中生培訓,在職人員轉行培訓,企業(yè)團訓

 1 String resource = "mybatis-config.xml"; 2         InputStream inputStream = null; 3         try { 4             // 獲取SqlSessionFactory 5             inputStream = Resources.getResourceAsStream(resource); 6             SqlSessionFactory factory = new SqlSessionFactoryBuilder().build(inputStream); 7             // 獲取SqlSession 8             SqlSession session = factory.openSession(); 9             try {10                 //method111                 //Student student = session.selectOne("cn.cgq.demo.mybatis.mapper.StudentMapper.selectStudent", 10);12                 //method213                 StudentMapper mapper=session.getMapper(StudentMapper.class);14                 Student student=mapper.selectStudent(new Long(10));15                 //輸出結果16                 System.out.print