spring整合mybatis
1、导包


2、 配置好mybatis,别忘了资源过滤

3、创建一个spring-dao.xml文件,甚至可以完全取代mybatis-config.xml

下面绑定mybatis使用的是configLoation 而不是configuration ,错了

4、需要创建一个UserMapperImpl类来实现接口(比以前麻烦了一点),然后在容器中注册


5、测试


可以把配置文件配置到总的ApplicationContext.xml中

1、导包


2、 配置好mybatis,别忘了资源过滤

3、创建一个spring-dao.xml文件,甚至可以完全取代mybatis-config.xml

下面绑定mybatis使用的是configLoation 而不是configuration ,错了

4、需要创建一个UserMapperImpl类来实现接口(比以前麻烦了一点),然后在容器中注册


5、测试


可以把配置文件配置到总的ApplicationContext.xml中
