连接池用${}取不到值

如果是手写驱动类、URL、用户名这些,不用${}取jdbc.properties文件里的值的话,就可以,怎么回事啊


<?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"

     xsi:schemaLocation="http://www.springframework.org/schema/beans

     http://www.springframework.org/schema/beans/spring-beans.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/tx

     http://www.springframework.org/schema/tx/spring-tx.xsd">

     

     <context:property-placeholder location="classpath:jdbc.properties"/>

     

     <bean id="dataSource" class="com.mchange.v2.c3p0.ComboPooledDataSource">

      <property name="driverClass" value="${driver}"/>

        <property name="jdbcUrl" value="${url}"/>

        <property name="user" value="${username}"/>

        <property name="password" value="${password}"/>

     </bean>


fenkapian
浏览 1371回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP

相关分类

Java