xml configuration -
<bean id="DS" class="org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name="driverClassName" value="${DB.DRIVERCLASS}" />
<property name="url" value="${TABLEMAINT.URL}" />
<property name="username" value="${TABLEMAINT.USER}" />
<property name="password" value="${TABLEMAINT.PASSWORD}" />
</bean>
@Component
class AbcDAO{
@Autowired
private DriverManagerDataSource DS;
public void getConnection(){
System.out.println("DS - "+DS..getConnection());
}
}
datasource DS.getConnection getting null pointer exception.
Autowiring not working.
Is there any solution?