一直显示读不到文件,后来发现是忘记加这句话了
<bean id="myDataSource" class="com.alibaba.druid.pool.DruidDataSource">
加到访问数据库的代码前面
<context:property-placeholder location="classpath:jdbc.properties"></context:property-placeholder>
<bean id="myDataSource" class="com.alibaba.druid.pool.DruidDataSource">
<property name="driverClassName" value="${jdbc.driver}"/>
<property name="url" value="${jdbc.url}"/>
<property name="username" value="${jdbc.username}"/>
<property name="password" value="${jdbc.password}"/>
</bean>