Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

App Config files

 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have to requirement like where in I need to read the configuration files. probably configuration files are XML and again I am free to choose the type of the configuration file.

Can I use the JPA to read the application configurations ? I don't want to use the DB to save the configurations How can I achieve this ?

Please suggest.
 
James Sutherland
Ranch Hand
Posts: 553
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you want to read XML files and convert them to objects, I would recommend JAXB. It is the standard for object-xml mapping.

EclipseLink Moxy supports JAXB and object-xml mapping.
 
William P O'Sullivan
Ranch Hand
Posts: 859
Chrome IBM DB2 Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is this a Spring framework application?

If so, you could extend PropertyPlaceHolderConfiguration and implement InitializingBean.

This will allow you to "inject" properties from either .properties files, xml, or DB.

We use this to maintain one single code-base packaged as a war and started pointing to one of many config files.

Pat.
 
Malatesh Karabisti
Ranch Hand
Posts: 153
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply, currently I am not using the Spring Frame work
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic