ibatis和 spring 如何结合
展开全部
在application.xml中加上:
<!-- 整合Ibatis -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:/config/sqlmaps/sql-map-config.xml">
</property>
<property name="dataSource" ref="dataSource"></property>
</bean>
再用一个类继承SqlMapClientDaoSupport类 来设置sqlMapClient
<!-- 整合Ibatis -->
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation" value="classpath:/config/sqlmaps/sql-map-config.xml">
</property>
<property name="dataSource" ref="dataSource"></property>
</bean>
再用一个类继承SqlMapClientDaoSupport类 来设置sqlMapClient
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询