Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7510885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:21:52+00:00 2026-05-29T23:21:52+00:00

I know this is probably a dumb question but I can’t figure it out

  • 0

I know this is probably a dumb question but I can’t figure it out for the life of me. Basically I am using maven to set my dataSource username, password, and driver class name. When I look in the effective Pom.xml it all appears fine as follows

<dataSource.driverClassName>oracle.jdbc.driver.OracleDriver</dataSource.driverClassName>
<dataSource.username>someUsername</dataSource.username>
<dataSource.password>somePassword</dataSource.password>

I am trying to use this information when declaring a spring datasource. The code appears as follows.

<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
    <property name="driverClassName" value="${dataSource.driverClassName}"/>
    <property name="url" value="${dataSource.url}"/>
    <property name="username" value="${dataSource.username}"/>
    <property name="password" value="${dataSource.password}"/>
</bean>

I then pass the datasource into a jdbcTemplate but when I use the template to run sql statements in my code I get an error saying that no driver with the name ${dataSource.driverClassName} can be found. This is obviously because the string constant is being passed rather than the variable. What am I missing?

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T23:21:54+00:00Added an answer on May 29, 2026 at 11:21 pm

    Spring is expecting to find those values in a .properties file.

    Inject a PropertyConfigurationPlaceholder with those values and Spring will find them.

    http://static.springsource.org/spring/docs/3.0.x/javadoc-api/org/springframework/beans/factory/config/PropertyPlaceholderConfigurer.html

    Look for example 3.8.2.1 below:

    http://static.springsource.org/spring/docs/3.0.x/spring-framework-reference/html/beans.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I know this is probably a really amateur question, but I can't figure this
This is probably a dumb question but I am trying to figure out how
I know this is probably really obvious, but I cannot figure out why I
This is probably a dumb question, but I can't seem to find a good
I know it's probably a dumb question, but I am stuck trying to figure
I know this is probably on the Internet somewhere but I can't find the
I know this is probably possible using Streams, but I wasn't sure the correct
I know this is probably a very simple question but how would I do
I know this question is probably stoopid. But I just don't want to cause
This is probably a simple question, but I really don't know what I'm doing

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.