11
zhouwei
2019-07-12 143f7be25ff19896e70ffc486999a64a3bc3b76f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
<?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:jdbc="http://www.springframework.org/schema/jdbc" xmlns:mvc="http://www.springframework.org/schema/mvc"
       xmlns:util="http://www.springframework.org/schema/util"
       xmlns:p="http://www.springframework.org/schema/p"
       xmlns:task="http://www.springframework.org/schema/task"
       xsi:schemaLocation="http://www.springframework.org/schema/beans
                     http://www.springframework.org/schema/beans/spring-beans.xsd
                     http://www.springframework.org/schema/tx
                     http://www.springframework.org/schema/tx/spring-tx.xsd
                     http://www.springframework.org/schema/context
                     http://www.springframework.org/schema/context/spring-context.xsd
                     http://www.springframework.org/schema/aop
                     http://www.springframework.org/schema/aop/spring-aop.xsd
                     http://www.springframework.org/schema/jdbc
                     http://www.springframework.org/schema/jdbc/spring-jdbc-3.2.xsd
                     http://www.springframework.org/schema/util
                     http://www.springframework.org/schema/util/spring-util-3.2.xsd
                     http://www.springframework.org/schema/mvc
                     http://www.springframework.org/schema/mvc/spring-mvc-3.2.xsd
                     http://www.springframework.org/schema/task
                     http://www.springframework.org/schema/task/spring-task-3.2.xsd">
    <!--<context:property-placeholder location="/WEB-INF/config.properties" ignore-unresolvable="true"/>-->
    <context:annotation-config />
    <context:property-placeholder location="classpath:*.properties" ignore-unresolvable="true" local-override="true"/>
    <!--<tx:annotation-driven  proxy-target-class="true" order="1"/>-->
 
 
    <!--<bean class="com.safeluck.common.util.BeanUtil"></bean>-->
 
    <bean id="dataSource" class="com.safeluck.aaej.base.dbhelper.multi.RoutingDataSource" primary="true" >
        <property name="targetDataSources">
            <map key-type="java.lang.String">
                <!--<entry value-ref="dataSource1" key="ppas1"></entry>-->
                <!--<entry value-ref="dataSource2" key="ppas2"></entry>-->
                <entry value-ref="dataSource6" key="ppas6"></entry>
                <entry value-ref="dataSource13" key="ppas13"></entry>
                <entry value-ref="gpsDataSource1" key="gps"></entry>
                <entry value-ref="gpsDataSource2" key="gps2"></entry>
                <entry value-ref="centerDataSource" key="center"></entry>
                <entry value-ref="imageDataSource" key="image"></entry>
                <entry value-ref="examDataSource" key="exam"></entry>
            </map>
        </property>
        <property name="defaultTargetDataSource" ref="dataSource6" >
        </property>
    </bean>
 
    <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate" >
        <constructor-arg ref="dataSource"/>
    </bean>
 
    <bean name="dataSource6" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.driver_class}"/>
        <property name="url" value="${jdbc.url6}" />
        <property name="username" value="${jdbc.username6}" />
        <property name="password" value="${jdbc.password6}" />
 
        <property name="maxActive" value="50" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
        <!--<property name="filters" value="stat" />-->
    </bean>
 
    <bean name="dataSource13" class="com.alibaba.druid.pool.DruidDataSource"
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.driver_class}"/>
        <property name="url" value="${jdbc.url13}" />
        <property name="username" value="${jdbc.username13}" />
        <property name="password" value="${jdbc.password13}" />
 
        <property name="maxActive" value="50" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
        <!--<property name="filters" value="stat" />-->
    </bean>
 
 
 
    <bean name="examDataSource" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.driver_class}"/>
        <property name="url" value="${jdbc.ay_exam_url}" />
        <property name="username" value="${jdbc.ay_exam_username}" />
        <property name="password" value="${jdbc.ay_exam_password}" />
 
        <property name="maxActive" value="10" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
        <!--<property name="filters" value="stat" />-->
    </bean>
 
 
 
 
    <bean name="gpsDataSource1" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.gps_driver_class}"/>
        <property name="url" value="${jdbc.gps_url}" />
        <property name="username" value="${jdbc.gps_username}" />
        <property name="password" value="${jdbc.gps_password}" />
 
        <property name="maxActive" value="20" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
    </bean>
 
    <bean name="gpsDataSource2" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.gps_driver_class}"/>
        <property name="url" value="${jdbc.gps_url2}" />
        <property name="username" value="${jdbc.gps_username2}" />
        <property name="password" value="${jdbc.gps_password2}" />
 
        <property name="maxActive" value="20" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
    </bean>
    <bean name="centerDataSource" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.gps_driver_class}"/>
        <property name="url" value="${jdbc.user_db_url}" />
        <property name="username" value="${jdbc.userdb_username}" />
        <property name="password" value="${jdbc.userdb_password}" />
 
        <property name="maxActive" value="50" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
    </bean>
 
    <bean name="imageDataSource" class="com.alibaba.druid.pool.DruidDataSource" 
          init-method="init" destroy-method="close">
        <property name="driverClassName" value="${jdbc.gps_driver_class}"/>
        <property name="url" value="${jdbc.image_url}" />
        <property name="username" value="${jdbc.image_username}" />
        <property name="password" value="${jdbc.image_password}" />
 
        <property name="maxActive" value="20" />
        <property name="initialSize" value="3" />
        <property name="maxWait" value="60000" />
        <property name="minIdle" value="3" />
 
        <property name="timeBetweenEvictionRunsMillis" value="60000" />
        <property name="minEvictableIdleTimeMillis" value="120000" />
 
        <property name="validationQuery" value="SELECT 'x'" />
        <property name="testWhileIdle" value="true" />
        <property name="testOnBorrow" value="false" />
        <property name="testOnReturn" value="false" />
 
        <!-- 打开removeAbandoned功能 -->
        <property name="removeAbandoned" value="true" />
        <property name="removeAbandonedTimeout" value="180" />
    </bean>
 
 
 
 
    <!--<context:component-scan base-package="com.safeluck.aaej.webapp.service" />-->
    <!--<context:component-scan base-package="com.safeluck.aaej.webapp.event" />-->
    <context:component-scan base-package="com.safeluck.aaej.base" />
    <context:component-scan base-package="com.safeluck.aaej.app.service" />
    <context:component-scan base-package="com.safeluck.aaej.app.config" />
 
    <!--<import resource="spring-config-dubbo.xml"/>-->
    <!--<aop:aspectj-autoproxy proxy-target-class="true" expose-proxy="true"/>-->
 
 
</beans>