Spring java- quartz schedular application
I want to load .property file dynamically passed throw program parameter instead of context:property-placeholder in spring context, how can i achieve this task, any help appreciated…
I am manually loading and refreshing spring context from main java file as illustrate by following code.
SpringUtil_1.loadSpringConfig();
rootContext = new ClassPathXmlApplicationContext();
rootContext.setConfigLocation("abc-configuration.xml");
rootContext.refresh();
In spring configuration i have context property place holder as follows which i want to from code.
<context:property-placeholder location="classpath:lnRuntime.properties"/>
i am using place holders in spring context and java file using spring EL as follows
<bean id="dataSource"
class="org.springframework.jdbc.datasource.SingleConnectionDataSource">
<property name="driverClassName" value="net.sourceforge.jtds.jdbcx.JtdsDataSource"/>
<property name="url" value="${dataSource.url}"/>
</bean>
and in java i am accesing as follows
private @Value("${dz.host}") String dzHost;
Found answer
Resoruces http://www.baeldung.com/2012/02/06/properties-with-spring/#byhandnew