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