/web/DRCP/war/WEB-INF/spring-persistence-transaction-local.xml

http://drcp.googlecode.com/ · XML · 40 lines · 15 code · 9 blank · 16 comment · 0 complexity · da6db2e6991df5f178f8f8858537983a MD5 · raw file

  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd">
  3. <!--
  4. - Application context definition for JPetStore's data access layer.
  5. - Accessed by business layer objects defined in "applicationContext.xml"
  6. - (see web.xml's "contextConfigLocation").
  7. -
  8. - This version of the data access layer works on a combined database,
  9. - using a local DataSource with DataSourceTransactionManager. It does not
  10. - need any JTA support in the container: It will run as-is in plain Tomcat.
  11. -->
  12. <beans>
  13. <!-- ========================= RESOURCE DEFINITIONS ========================= -->
  14. <!-- Local Apache Commons DBCP DataSource that refers to a combined database -->
  15. <!-- (see dataAccessContext-jta.xml for an alternative) -->
  16. <!-- The placeholders are resolved from jdbc.properties through -->
  17. <!-- the PropertyPlaceholderConfigurer in applicationContext.xml -->
  18. <bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
  19. destroy-method="close">
  20. <property name="driverClassName" value="${jdbc.driverClassName}"/>
  21. <property name="url" value="${jdbc.url}"/>
  22. <property name="username" value="${jdbc.username}"/>
  23. <property name="password" value="${jdbc.password}"/>
  24. </bean>
  25. <!-- Transaction manager for a single JDBC DataSource -->
  26. <!-- (see dataAccessContext-jta.xml for an alternative) -->
  27. <bean id="transactionManager"
  28. class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
  29. <property name="dataSource" ref="dataSource"/>
  30. </bean>
  31. </beans>