I\'m using Spring Boot
and have issues scheduling a cron task
using values existing in database.
For the time being, I\'m reading values f
You need to load properties from the database table in which your value stored. and merge that db properties with application properties
@Autowired
private DataSource dataSource;
@Autowired
private DatabaseConfiguration configuration;
@Bean(name = "propertyConfig")
public DatabaseConfiguration getDatabaseConfiguration() {
DatabaseConfiguration configuration = new DatabaseConfiguration(dataSource, "propertyTable", "key", "value");
return configuration;
}
@Bean(name = "dbProperty")
public Properties getDBProperties(){
Properties properties = ConfigurationConverter.getProperties(configuration);
return properties;
}
For more help refer https://analyzejava.wordpress.com/2015/01/16/loading-configuration-properties-from-database-in-spring-based-application/