applicationContext.xml
view plaincopy to clipboardprint?
<?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="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@172.17.7.191:1521:STRUTS</value>
</property>
<property name="username">
<value>STRUTS</value>
</property>
<property name="password">
<value>STRUTS</value>
</property>
</bean>
<bean id="insertDao" class="flex.samples.spring.dao.InsertCl">
<property name="sqlMapClient">
<ref local="sqlMapClient" />
</property>
</bean>
<bean name="insertAction"
class="flex.samples.spring.action.InsertAction">
<property name="insertService">
<ref bean="insertService"/>
</property>
</bean>
<bean id="insertService"
class="flex.samples.spring.dao.InsertService">
<property name="insertDao">
<ref local="insertDao" />
</property>
</bean>
<bean id="sqlMapClient"
class="org.springframework.orm.ibatis.SqlMapClientFactoryBean">
<property name="configLocation">
<value>
WEB-INF/SqlMapConfig.xml
</value>
</property>
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean name="logger"
class="flex.samples.spring.interceptor.LoggingInterceptor">
</bean>
<bean name="beanNameAutoProxy"
class="org.springframework.aop.framework.autoproxy.BeanNameAutoProxyCreator" />
<bean id="transactionProxy" parent="beanNameAutoProxy">
<property name="beanNames">
<list>
<value>insertService</value>
</list>
</property>
<property name="interceptorNames">
<value>transactionInterceptor</value>
</property>
</bean>
<bean id="logginProxy" parent="beanNameAutoProxy">
<property name="beanNames">
<list>
<value>insertDao</value>
</list>
</property>
<property name="interceptorNames">
<value>logger</value>
</property>
</bean>
<bean id="transactionManager"
class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
<property name="dataSource">
<ref bean="dataSource" />
</property>
</bean>
<bean id="transactionInterceptor" class="org.springframework.transaction.interceptor.TransactionInterceptor">
<property name="transactionManager">
<ref local="transactionManager" />
</property>
<property name="transactionAttributes">
<props>
<prop key="*">PROPAGATION_REQUIRED,-Exception</prop>
</props>
</property>
</bean>
</beans>
<?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="dataSource"
class="org.springframework.jdbc.datasource.DriverManagerDataSource">
<property name="driverClassName">
<value>oracle.jdbc.driver.OracleDriver</value>
</property>
<property name="url">
<value>jdbc:oracle:thin:@172.17.7.191:1521:STRUTS</value>
</property>
<property name="username">
<value>STRUTS</value>
</property>
<property name="password">
<value>STRUTS</value>
</property>
</bean>
相关专题
- Spring开源框架技术 (838篇文章)
- 数据库处理专题 (9236篇文章)
- Spring开发技术篇 (336篇文章)
- Struts 2, spring 2, hibernate 的整合 (403次浏览)
- Java远程通讯的6种可选技术及原理 (279次浏览)
- struts2 + spring + hibernate 实现CRUD (217次浏览)
- Spring 与 Log4J 进行动态日志配置切换 (182次浏览)
- 初学者对Hibernate的学习方法 (168次浏览)
- Hibernate的映射关联关系 (154次浏览)
- Spring与struts整合开发实例(一) (111次浏览)
- Java调用SQL Server的存储过程详解 (109次浏览)
- MyEclipse搞定hibernate的web应用 (104次浏览)
- 多动鼠标少动脑,Java报表工具的简约之美 (92次浏览)



