随笔-196  评论-90  文章-8  trackbacks-0

 <!-- 配置数据库连接 -->
 <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
  <property name="driverClassName">
   <value>oracle.jdbc.driver.OracleDriver</value>
  </property>  
  <property name="url">
   <value>jdbc:oracle:thin:@33.49.23.168:1521:oradb</value>
  </property>
  <property name="username">
   <value>chinacars</value>
  </property>
  <property name="password">
   <value>chinacars</value>
  </property> 
 </bean> 
    
<!-- 配置sessionFactory, 注意这里引入的包的不同  -->
 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource">
   <ref local="dataSource" />
  </property>
  <property name="mappingResources">
   <list>   
    <value>com/chinacars/wap/beans/WapCategory.hbm.xml</value>
   </list>
  </property>
  <property name="hibernateProperties">
   <props>
    <prop key="hibernate.dialect">org.hibernate.dialect.Oracle9Dialect</prop>
    <prop key="hibernate.show_sql">true</prop>
    <prop key="hibernate.c3p0.minPoolSize">0</prop>
                <prop key="hibernate.c3p0.maxPoolSize">5</prop>
                <prop key="hibernate.c3p0.timeout">600</prop>
                <prop key="hibernate.c3p0.max_statement">200</prop>
   </props>
  </property>  
 </bean>

 <!-- Manager -->
 <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager">
  <property name="sessionFactory">
   <ref local="sessionFactory" />
  </property>
 </bean>

 <!--
  ******* DAO setting *******
 -->

 <bean id="statDayDao" class="com.ihandy.statsms.dao.impl.StatDayDaoImpl">
  <property name="sessionFactory">
   <ref local="sessionFactory" />
  </property>
 </bean>

 <bean id="statDayDaoProxy" class="org.springframework.transaction.interceptor.TransactionProxyFactoryBean">
  <property name="transactionManager">
   <ref bean="transactionManager" />
  </property>
  <property name="target">
   <ref local="statDayDao" />
  </property>
  <property name="transactionAttributes">
   <props>
    <prop key="insert*">PROPAGATION_REQUIRED</prop>
    <prop key="get*">PROPAGATION_REQUIRED,readOnly</prop>
    <prop key="is*">PROPAGATION_REQUIRED,readOnly</prop>
   </props>
  </property>
 </bean> 
 
  <!--
  ******* Service setting *******
 -->

 <bean id="statDayService" class="com.ihandy.statsms.service.impl.StatDayServiceImpl">
  <property name="statDayDao">
   <ref bean="statDayDaoProxy" />
  </property>
 </bean>
 
 <!-- Struts Action Proxy -->
 <bean name="/statDayList" class="com.ihandy.statsms.struts.action.StatDayListAction" singleton="false">
  <property name="statDayService">
   <ref bean="statDayService" />
  </property>
 </bean>

posted on 2007-04-13 16:09 一凡 阅读(211) 评论(0)  编辑  收藏 所属分类: JAVA FRAMEWORK

只有注册用户登录后才能发表评论。


网站导航: