摘要:
主要内容 1、Resource 2、SqlSessionFactoryBuilder 3、SqlSessionFactory 4、SqlSession 1. Resource resource是 mybatis中的一个类,主要负责读取主配置文件的内容 // 1、格式 使用方法: getResourc 阅读全文
摘要:
使用MyBatis的步骤 1、pom.xml依赖: 添加使用mybatis需要的依赖和其他配置,插件 2、类文件: 创建对应数据库表的实体类和访问数据的dao接口 1)、实体类 Student.java 2)、dao接口 StudentDao.java 3、配置文件: 创建mybatis所需的配置文 阅读全文
摘要:
MyBatis入门案例 创建项目 添加依赖 创建配置文件和类文件并编写内容 创建测试类测试sql操作 阅读全文
摘要:
在第一次使用mybatis时,可能会遇到很多问题,涉及到配置文件的创建和内容的编写,稍不注意就会出错。所以在使用mybatis过程中需要注意的问题 mybatis中的两种文件 sql映射文件: sql mapper,即sql语句映射的配置文件 mybatis主配置文件 1. sql映射文件 1、文件 阅读全文