|
1 | 1 | <?xml version="1.0" encoding="UTF-8"?>
|
| 2 | +<!-- |
| 3 | + ~ The MIT License (MIT) |
| 4 | + ~ |
| 5 | + ~ Copyright (c) 2014 [email protected] |
| 6 | + ~ |
| 7 | + ~ Permission is hereby granted, free of charge, to any person obtaining a copy |
| 8 | + ~ of this software and associated documentation files (the "Software"), to deal |
| 9 | + ~ in the Software without restriction, including without limitation the rights |
| 10 | + ~ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 11 | + ~ copies of the Software, and to permit persons to whom the Software is |
| 12 | + ~ furnished to do so, subject to the following conditions: |
| 13 | + ~ |
| 14 | + ~ The above copyright notice and this permission notice shall be included in |
| 15 | + ~ all copies or substantial portions of the Software. |
| 16 | + ~ |
| 17 | + ~ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 18 | + ~ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 19 | + ~ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 20 | + ~ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 21 | + ~ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 22 | + ~ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 23 | + ~ THE SOFTWARE. |
| 24 | + --> |
| 25 | + |
2 | 26 | <beans xmlns="http://www.springframework.org/schema/beans"
|
3 | 27 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
4 |
| - xmlns:jdbc="http://www.springframework.org/schema/jdbc" |
5 | 28 | xmlns:tx="http://www.springframework.org/schema/tx"
|
6 | 29 | xmlns:aop="http://www.springframework.org/schema/aop"
|
7 | 30 | xmlns:context="http://www.springframework.org/schema/context"
|
8 |
| - xmlns:util="http://www.springframework.org/schema/util" |
9 | 31 | xsi:schemaLocation="http://www.springframework.org/schema/beans
|
10 | 32 | http://www.springframework.org/schema/beans/spring-beans.xsd
|
11 |
| - http://www.springframework.org/schema/jdbc |
12 |
| - http://www.springframework.org/schema/jdbc/spring-jdbc.xsd |
13 | 33 | http://www.springframework.org/schema/tx
|
14 | 34 | http://www.springframework.org/schema/tx/spring-tx.xsd
|
15 | 35 | http://www.springframework.org/schema/aop
|
16 | 36 | http://www.springframework.org/schema/aop/spring-aop.xsd
|
17 | 37 | http://www.springframework.org/schema/context
|
18 |
| - http://www.springframework.org/schema/context/spring-context.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd"> |
| 38 | + http://www.springframework.org/schema/context/spring-context.xsd"> |
19 | 39 |
|
20 | 40 | <context:component-scan base-package="com.isea533.mybatis.service"/>
|
21 | 41 |
|
22 | 42 | <context:property-placeholder location="classpath:config.properties"/>
|
23 | 43 |
|
24 |
| - <!--hsqldb测试数据库--> |
25 |
| - <jdbc:embedded-database id="dataSource"> |
26 |
| - <jdbc:script location="classpath:hsqldb.sql"/> |
27 |
| - </jdbc:embedded-database> |
| 44 | + <!-- c3p0 --> |
| 45 | + <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource" destroy-method="close"> |
| 46 | + <property name="driverClass" value="${jdbc.driverClass}"/> |
| 47 | + <property name="jdbcUrl" value="${jdbc.url}"/> |
| 48 | + <property name="user" value="${jdbc.user}"/> |
| 49 | + <property name="password" value="${jdbc.password}"/> |
| 50 | + <property name="maxPoolSize" value="${jdbc.maxPoolSize}"/> |
| 51 | + <property name="minPoolSize" value="${jdbc.minPoolSize}"/> |
| 52 | + <property name="maxStatements" value="${jdbc.maxStatements}"/> |
| 53 | + <property name="testConnectionOnCheckout" value="${jdbc.testConnection}"/> |
| 54 | + </bean> |
28 | 55 |
|
29 | 56 | <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
|
30 | 57 | <property name="dataSource" ref="dataSource"/>
|
|
76 | 103 | <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
|
77 | 104 | <property name="dataSource" ref="dataSource"/>
|
78 | 105 | </bean>
|
79 |
| - |
| 106 | + |
80 | 107 | <bean class="com.github.abel533.mapperhelper.MapperHelper"
|
81 | 108 | depends-on="sqlSession" init-method="initMapper" scope="singleton" lazy-init="false">
|
82 | 109 | <property name="mappers">
|
|
0 commit comments