首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > Web前端 >

Spring 配置文件(组合ibatis)

2013-01-17 
Spring 配置文件(结合ibatis)?xml version1.0 encodingUTF-8?beans xmlnshttp://www.springfra

Spring 配置文件(结合ibatis)
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd">

   <!-- <bean id="propertyConfigurer"
          value="oracle.jdbc.driver.OracleDriver"></property>
    <property name="username" value="scott"></property>
<property name="password" value="tiger"></property>
<property name="url" value="jdbc:oracle:thin:@10.4.115.71:1521:orcl"></property>
<property name="maxActive" value="100"></property>
<property name="maxIdle" value="20"></property>
<property name="maxWait" value="1000"></property>
</bean>
<!-- 事务配置 -->
<bean id="transactionManager"
      ref="dataSource"/> 
</bean>
<!-- 代理基类 -->
<bean id="txProxyTemplate" abstract="true"
       />
</property>
<property name="transactionAttributes">
<props>
<prop key="do*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
    <!-- Spring 和 iBatis 的融合 -->
    <!-- 根据数据访问资源,实例化SqlMapClient对象 -->
    <bean id="baseSqlMapClient" value="classpath:../config/SqlMapconfig.xml"/>
       <property name="dataSource" ref="dataSource"/>
    </bean>
        <!-- 创建sqlMapClientTemplate -->
    <bean id="baseSqlMapClientTemplate" ref="baseSqlMapClientTemplate"/>
    </bean>
       <!-- 实例化实体DAO,注入BaseDAO -->
    <bean id="testDao" parent="baseDAO"/>
     <!-- BO配置 -->
    <bean id="testBo" parent="txProxyTemplate">
       <property name="target">
          <bean ref="testDao"></property>
          </bean>
       </property>
    </bean>
  <!-- action配置 -->
    <bean name="/empInformation"
          ref="testBo"></property>
    </bean>
</beans>

热点排行