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>

你可能感兴趣的:(spring,数据)