`
newslxw
  • 浏览: 208301 次
  • 性别: Icon_minigender_1
  • 来自: 广州
社区版块
存档分类
最新评论

spring+ibatis整合方法

阅读更多
1、spring配置文件中增加以下代码
<bean id="sqlMapClient" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
    <property name="configLocation" value="classpath:conf/ibatis/sqlmap-config.xml"/>
    <property name="dataSource" ref="dataSource" />
  </bean>

<bean id="xxxxx" class="xxxxxx">
<property name="sqlMapClient" ref="sqlMapClient"/>
</bean>
2、ibatis配置文件sqlmap-config.xml中引入具体的ibatis配置文件即可
<sqlMap resource="conf/ibatis/ibatis.xxx.xml" />

3、所有dao类都继承com.ibatis.sqlmap.client.SqlMapClient
分享到:
评论
1 楼 萧十一狼 2012-01-30  
所有dao类都继承com.ibatis.sqlmap.client.SqlMapClient?
spring有支持的啊

相关推荐

Global site tag (gtag.js) - Google Analytics