Friday, June 26, 2015

Autowire datasource while using JdbcDAOSupport

public class EntityDAO extends JdbcDaoSupport{

Logger logger = LoggerFactory.getLogger(EntityDAO.class);

@Autowired
private DataSource datasource;


/*
* Setting data source as it extends jdbcDAOSupport
*/
@Autowired
private void initialize()
{
setDataSource(datasource);
}

No comments:

Post a Comment