spring 3.0.5 与ibatis2.3整合要点

spring 3.0.5 与ibatis2.3整合要点:
环境:spring 3.0.5 所有jar文件,以及dbcp数据连接池、log4j等的相关jar文件
            ibatis jar文件
1、 根据dataSource和configuration创建一个sqlMapClient
       使用的是spring提供的org.springframework.orm.iabtis.
SqlMapClientFactoryBean
  <bean id="sqlMapClient" 
        class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
        <property name="configLocation" value="classpath:sql-map-config.xml" />----ibatis主配置文件的位置
        <property name="dataSource" ref="dataSource" />------依赖的数据源
  </bean>
2、 配置SqlMapClientTemplate模板类
      使用的是spring提供的org.springframework.orm.ibatis.SqlMapClientTemplate类
  <bean id="sqlMapClientTemplate" 
        class="org.springframework.orm.ibatis.SqlMapClientTemplate">
        <constructor-arg ref="sqlMapClient"/> ----依赖的SqlMapClient
  </bean>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章