I am reading property files using the following entry in my Spring xml.
<context:property-placeholder
location="classpath:resources/database1.properties,
classpath:resources/licence.properties"/>
I entered these values into a variable using an xml entry, or using annotation @Value.
<bean id="myClass" class="MyClass">
<property name="driverClassName" value="${database.driver}" />
<property name="url" value="${database.url}" />
<property name="name" value="${database.name}" />
</bean>
I want to add a new properties file ( database2.properties) that has several identical variable names, such as database1.properties.
database1.properties:
database.driver=com.mysql.jdbc.Driver
database.url=jdbc:mysql://192.168.1.10/
database.name=dbname
database2.properties:
database.url=jdbc:mysql://192.168.1.50/
database.name=anotherdbname
database.user=sampleuser
You can see that several property variables have the same name, for example database.url, database.namein property files.
Can I database.urlenter2.properties from the database?
Or do I need to change variable names?
Thank.