Override the launchContext.xml
Hi all,
ClassPathXmlApplicationContext is always the expecting the launch-context.xml or job.xml file to be part of the bundle package (i.e. jar) now I want to be read the file from Obsolute path.
Can any one please let me know how to achieve this.
ClassPathXmlApplicationContext configAppContext = new ClassPathXmlApplicationContext("launch-context.xml");
OR atleast if at all i can achieve this?
I need to override the property value set in the context.xml file
<context:property-placeholder location="classpath:batch-mysql.properties" />
the location value has to be read from the obsolete path.
<context:property-placeholder location="/home/ravi/batch-mysql.properties" />
OR to override the property value of the batch-mysql.properties
batch-mysql.properties contents are:
batch.jdbc.driver=com.mysql.jdbc.Driver
batch.jdbc.url=jdbc:mysql://localhost:3306/test
batch.jdbc.user=root
batch.jdbc.password=kodiak
batch.jdbc.testWhileIdle=true
batch.jdbc.validationQuery=SELECT 1
batch.jdbc.verifyCursorPosition=true
batch.drop.script=classpath:/org/springframework/batch/core/schema-drop-mysql.sql
batch.schema.script=classpath:/org/springframework/batch/core/schema-mysql.sql
batch.business.schema.script=classpath:business-schema-mysql.sql
batch.data.source.init=true
batch.database.incrementer.class=org.springframewo rk.jdbc.support.incrementer.MySQLMaxValueIncrement er
batch.database.incrementer.parent=columnIncremente rParent
batch.lob.handler.class=org.springframework.jdbc.s upport.lob.DefaultLobHandler
batch.jdbc.pool.size=6
batch.grid.size=50
batch.verify.cursor.position=true
I need to override this batch.jdbc.url value based on the deployment server network address