最近项目用到了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: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">