Reprinted from: http://blog.csdn.net/weinichendian/article/details/51253506
1. spring-context.xml file
[HTML] View Plain copy <?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:context=" Http://www.springframework.org/schema/context " xmlns:aop= "HTTP://WWW.SPRINGFRAMEWORK.ORG/SCHEMA/AOP" xmlns:tx= "/HTTP/ Www.springframework.org/schema/tx " xmlns:mvc=" http// Www.springframework.org/schema/mvc " xmlns:task=" Http://www.springframework.org/schema/task " xmlns:p= "http://www.springframework.org/schema/p" xsi:schemalocation= " http://www.springframework.org /schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-4.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-4.0.xsd http://www.springframework.org/schema/aop http:// www.springframework.org/schema/aop/spring-aop-4.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/ spring-beans-4.0.xsd http://www.springframework.org /schema/task http://www.springframework.org/schema/task/spring-task-4.0.xsd http://www.springframework.org/schema/context http:// Www.springframework.org/schema/context/spring-context-4.0.xsd "> < data source configuration for!-- data synchronization <bean id= "DataSource" class= " Com.mchange.v2.c3p0.ComboPooledDataSource "> <property name= "Driverclass" value= "Com.mysql.jdbc.Driver" /> <property name= "Jdbcurl" value= "Jdbc:mysql://ip:3306/amb_car_accessory?autoreconnect=true&useunicode=true&characterencoding=utf-8 &allowmultiqueries=true " /> < Property name= "User" value= " /> <property name=" password " value=" " /> <property name= "MinPoolSize" value= "1" /> <property name= "maxpoolsize" value= " /> <property name=" MaxIdleTime " value=" 1800 " /> <property name= "Acquireincrement" value= "2" /> <property name=" "maxstatements"