Guest User

Untitled

a guest
Jan 7th, 2019
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.49 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:jee="http://www.springframework.org/schema/jee"
  5. xmlns:aop="http://www.springframework.org/schema/aop"
  6. xmlns:tx="http://www.springframework.org/schema/tx"
  7. xmlns:context="http://www.springframework.org/schema/context"
  8. xsi:schemaLocation=" http://www.springframework.org/schema/beans
  9. http://www.springframework.org/schema/beans/spring-beans.xsd
  10. http://www.springframework.org/schema/context
  11. http://www.springframework.org/schema/context/spring-context-3.0.xsd
  12. http://www.springframework.org/schema/jee
  13. http://www.springframework.org/schema/jee/spring-jee-3.0.xsd
  14. http://www.springframework.org/schema/tx
  15. http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
  16. http://www.springframework.org/schema/aop
  17. http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
  18.  
  19. <context:annotation-config />
  20.  
  21. <tx:annotation-driven transaction-manager="txManager" />
  22.  
  23. <bean id="transactionManager"
  24. class="org.springframework.jdbc.datasource.DataSourceTransactionManager" >
  25. <property name="DataSource" ref="DataSource" />
  26. </bean>
  27.  
  28. <tx:advice id="txAdvice" transaction-manager="transactionManager">
  29. <tx:attributes>
  30. <tx:method name="add*" propagation="REQUIRED" />
  31. </tx:attributes>
  32. </tx:advice>
  33.  
  34. <aop:config>
  35. <aop:advisor
  36. id="advisor"
  37. pointcut-ref="pointcut"
  38. advice-ref="txAdvice" />
  39. </aop:config>
  40.  
  41. <aop:config>
  42. <aop:pointcut
  43. id="pointcut"
  44. expression="execution(* com.example.JdbcJobDAO.*(..))" />
  45. </aop:config>
  46.  
  47. <bean id="DataSource"
  48. class="org.springframework.jdbc.datasource.DriverManagerDataSource">
  49. <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver" />
  50. <property name="url" value="jdbc:oracle:thin:@localhost:1521:xe" />
  51. <property name="username" value="system" />
  52. <property name="password" value="1234" />
  53. </bean>
  54.  
  55. <bean id="jdbcTemplate"
  56. class="org.springframework.jdbc.core.JdbcTemplate">
  57. <constructor-arg ref="DataSource" />
  58. </bean>
  59.  
  60.  
  61. <bean id="jdbcJobDAOImpl" class="com.example.JdbcJobDAOImpl">
  62. <property name="jdbcTemplate" ref="jdbcTemplate" />
  63. </bean>
Add Comment
Please, Sign In to add comment