dataSource.xml 1.0 KB

12345678910111213141516171819202122
  1. <?xml version="1.0" encoding="UTF-8"?>
  2. <beans xmlns="http://www.springframework.org/schema/beans"
  3. xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  4. xmlns:context="http://www.springframework.org/schema/context"
  5. xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
  6. http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd
  7. ">
  8. <context:property-placeholder location="classpath:jdbc.properties"/>
  9. <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource">
  10. <property name="driverClassName" value="${jdbc.driver}"/>
  11. <property name="url" value="${jdbc.url}"/>
  12. <property name="username" value="${jdbc.username}"/>
  13. <property name="password" value="${jdbc.password}"/>
  14. </bean>
  15. <bean id="jdbcTemplate" class="org.springframework.jdbc.core.JdbcTemplate">
  16. <property name="dataSource" ref="dataSource"/>
  17. </bean>
  18. </beans>