|
@@ -3,9 +3,20 @@
|
3
|
3
|
<beans xmlns="http://www.springframework.org/schema/beans"
|
4
|
4
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
5
|
5
|
xmlns:context="http://www.springframework.org/schema/context"
|
6
|
|
- xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
|
|
6
|
+ xsi:schemaLocation="http://www.springframework.org/schema/beans
|
|
7
|
+ http://www.springframework.org/schema/beans/spring-beans.xsd
|
|
8
|
+ http://www.springframework.org/schema/context
|
|
9
|
+ https://www.springframework.org/schema/context/spring-context.xsd">
|
7
|
10
|
<!-- <bean id="userService1" class="com.service.impl.UserServiceImpl">-->
|
8
|
11
|
<!--<!– <constructor-arg name="userDao" ref="UserDao"></constructor-arg>–>-->
|
9
|
12
|
<!-- </bean>-->
|
|
13
|
+<!-- 加载外部 properties文件-->
|
|
14
|
+ <context:property-placeholder location="jdbc.properties"></context:property-placeholder>
|
|
15
|
+ <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
|
|
16
|
+ <property name="driverClassName" value="${jdbc.driver}"></property>
|
|
17
|
+ <property name="url" value="${jdbc.url}"></property>
|
|
18
|
+ <property name="username" value="${jdbc.username}"></property>
|
|
19
|
+ <property name="password" value="${jdbc.password}"></property>
|
|
20
|
+ </bean>
|
10
|
21
|
<context:component-scan base-package="com"></context:component-scan>
|
11
|
22
|
</beans>
|