• Post Reply Bookmark Topic Watch Topic
  • New Topic

Packaged jar needs to read info from properties file in local file system  RSS feed

 
Balaji Pooruli
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

This is my first post in coderanch forums. I did search for my query in forums, but could not find an answer for it. So, I am posting my query here.

I am creating a packaged jar file in Eclipse IDE that contains couple of java classes to achieve some functionality. The java classes use a resource or property file that is also packaged as part of the jar. However, I need to use this jar in 3 different servers (DEV, QA and PROD). When used from the server, the jar file should NOT use the packaged resource file. Instead, I want the classes in the jar file to read the information from the resource file from the local file system. The properties file name is dbconfig.properties, but the database credentials for DEV, QA and PROD are different and hence I would like to supply the information from a property file from the local file system.

Can some one help me how to achieve this?

Thanks,
Balaji.
 
Jayesh A Lalwani
Rancher
Posts: 2762
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How is the Java code reading the property file? What API is it using? Is it loading from classpath? If it's loading from classpath, you need to put your local folder in the classpat
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!