应用上下文-applicationContext.xml

来源:互联网 发布:网络监控视频怎么截取 编辑:程序博客网 时间:2024/06/05 15:16

 <!--以下是在实际开发中正常运行的有效代码-->

<?xml version="1.0" encoding="UTF-8"?>
<!--
  - Middle tier application context definition for the image database.
  -->
<beans xmlns="http://www.springframework.org/schema/beans"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:aop="http://www.springframework.org/schema/aop"
  xmlns:tx="http://www.springframework.org/schema/tx"
  xsi:schemaLocation="
   http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd
   http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd
   http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.5.xsd">
    <aop:aspectj-autoproxy/>
   
     <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
     <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
     <property name="url" value="jdbc:oracle:thin:@192.168.1.139:1521:teleflat"/>
     <property name="username" value="teleflat"/>
     <property name="password" value="123456"/>
     </bean>

 <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
  <property name="dataSource" ref="dataSource"/>
  <property name="mappingResources">
   <list>
   <!-- add hbm.xml here
   <value>net/splendot/teleflat/employeeMgr/baseEmp/vo/BaseEmpModel.hbm.xml</value>
   -->
   </list>
  </property>
  <property name="hibernateProperties">
   <value>
     hibernate.dialect=org.hibernate.dialect.OracleDialect
   </value>
  </property>
 </bean>
           
 <tx:annotation-driven transaction-manager="txManager"/>
           
 <bean id="txManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  <property name="dataSource" ref="dataSource"/>
 </bean>

</beans>

原创粉丝点击