步骤:
1.导入jar包
junit
mybatis
mysql数据库
Spring相关
aop植入
mybatis-Spring 【新包】
2.编写配置文件
{(mybati回忆):1.编写实体类 2.编写配置文件 3.编写接口 4.编写Mapper.xml 5.测试}
3.测试
Mybatis-Spring:
1.编写数据源配置
2.sqlSessionFactory
3.sqlSessionTemple
4.需要给接口加实现类
5.将自己写的实现类注入到Spring中
6,测试使用即可
Mybatis原来使用时步骤:
原Spring使用步骤:
用Spring整合Mybatis后变为: