Spring Multiple Properties files

Is it possible have multiple physical properties files loaded into the same property class ?
I currently have file
and want to split it into two files

and have the contetns loaded into the same Properties fecSql instance ?

public abstract class AbstractDao {
      protected Properties fecSql = null;
      protected Properties posSql = null;

      public void setFecSql(Properties props){this.fecSql = props;}
      public void setPosSql(Properties props){this.posSql = props;}

//where doa-config.xml has
<util:properties id="fecSql" location="classpath:sql/queries.fec.properties" />
<util:properties id="posSql" location="classpath:sql/queries.pos.properties" />

<bean id="abstractDao" class="com.cme.citps.dataAccess.AbstractDao" abstract="true">
          <property name="fecSql" ref="fecSql" />
          <property name="posSql" ref="posSql" />

//and the properties are referenced by

public class FECDetailsDao extends AbstractDao {
String dsName = this.connectionUtil.getProperty(this.fecSql,CITPSConstants.DATASOURCE_PREFIX, env, exchange);
Who is Participating?
WaponiConnect With a Mentor Author Commented:
Remove the old reference to the single properties file
<util: properties id="fecSql"
location="classpath:sql/queries.fec.properties" />

And add PropertiesFactoryBean, include the new properties files
<bean id="fecSql"
<property name="ignoreResourceNotFound" value="true"/>
    <property name="locations">
WaponiAuthor Commented:
Solution, add PropertiesFactoryBean
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.