Hi, I would like execute and jdbctemplate from a java class, to do that i get the datasource from a bean, the problem is that the properties of my datasource comes from a file.
java class:
bean:Code:ApplicationContext ac = new ClassPathXmlApplicationContext("classpath:datasource.xml"); DataSource datasource = (DataSource) ac.getBean("dataSource");
error:Code:<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource" > <property name="driverClassName" value="${database.driverClassName}" /> <property name="url" value="${database.url}" /> <property name="username" value="${database.username}" /> <property name="password" value="${database.password}" /> </bean>
any solution provided by Spring? thx!Code:CannotGetJdbcConnectionException: Could not get JDBC Connection; nested exception is org.apache.commons.dbcp.SQLNestedException: Cannot load JDBC driver class '${database.driverClassName}'


Reply With Quote