Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?xml version="1.0" encoding="UTF-8"?>
- <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:context="http://www.springframework.org/schema/context"
- xmlns:tx="http://www.springframework.org/schema/tx"
- xmlns:util="http://www.springframework.org/schema/util"
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
- http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop.xsd
- http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd">
- <!-- Database Connection pool -->
- <bean id="dataSource1"
- class="com.zaxxer.hikari.HikariDataSource">
- <property name="driverClassName" value="com.mysql.jdbc.Driver"></property>
- <property name="jdbcUrl" value="jdbc:mysql://localhost:3306/cloudms"></property>
- <property name="username" value="admin"></property>
- <property name="password" value="admin"></property>
- <property name="autoCommit" value="false"></property>
- </bean>
- <bean id="transactionManager"
- class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
- <property name="dataSource" ref="dataSource1"></property>
- </bean>
- <!-- Configure JdbcTemplate -->
- <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
- <property name="dataSource" ref="dataSource1"></property>
- </bean>
- <bean id="flightsRepository"
- class="com.myapp.spring.mvc.dao.FlightsRepositoryImpl"
- autowire="constructor">
- </bean>
- <!-- View Resolver -->
- <!-- JSP + JSTL View -->
- <bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver">
- <property name="prefix" value="/WEB-INF/jsp/"></property>
- <property name="suffix" value=".jsp"></property>
- </bean>
- <!-- Aspect -->
- <tx:advice id="txAdvice" transaction-manager="transactionManager">
- <tx:attributes>
- <!-- all methods starting with 'list' or 'get' are read-only -->
- <tx:method name="search*" propagation="REQUIRED"/>
- </tx:attributes>
- </tx:advice>
- <aop:config>
- <aop:advisor pointcut-ref="serviceMethods" advice-ref="txAdvice" />
- <aop:aspect>
- <aop:pointcut id="serviceMethods"
- expression="execution(* com.myapp.spring.jdbc.*.*(..))" />
- </aop:aspect>
- </aop:config>
- </beans>
Add Comment
Please, Sign In to add comment