Spring tomcat jdbc pool mybatis 集成配置

2014-11-24 10:36:19 · 作者: · 浏览: 0

最近项目用到了Spring、Tomcat7自带的数据库连接池tomcat jdbc pool 、mybatis,现将三者集成的配置记录一下,以备不时之需。

所需的jar包:

spring框架需要的jar包(这里就不详细说了)

mybatis-3.1.1.jar
mybatis-spring-1.1.1.jar
mysql-connector-java-5.1.15-bin.jar
tomcat-jdbc.jar
tomcat-juli.jar
配置文件如下:

[html]
< xml version="1.0" encoding="UTF-8" >
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
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-3.0.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd">





mysql.jdbc.Driver"/>
























class="org.springframework.jdbc.datasource.DataSourceTransactionManager">








PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,-Exception
PROPAGATION_REQUIRED,readOnly
PROPAGATION_REQUIRED,readOnly








*Service




transactionInterceptor