title: Best Way to read configuration file
body: <p>I need to ask for the best way how to read the configuration file for my application. 
  Currently what I'm doing is put the above code in my Java program, get all configuration item that I want, and then pass the value to the function that requires the variable.</p>
  
  <p>What is the best way for me to let the configuration file to load only once and can be used in the other process (other users)?</p>
  
  <pre><code>File configFile = new File("D:\\config.properties");
  
  try {
      FileReader reader = new FileReader(configFile);
      Properties prop = new Properties();
      prop.load(reader);
  
      String dbName = prop.getProperty("dbName");
      String dBase = prop.getProperty("database");
  
      String strMethod1 = prop.getProperty("method1"); 
      int method1 = Integer.parseInt(strMethod1);
  
      String strMethod2 = prop.getProperty("method2"); 
      int method2 = Integer.parseInt(strMethod2);
  
  } catch (IOException e) {
      returnValue = IO_EXCEPTION;
      logger.error("IOException:::" + e + "  returnValue:::" + returnValue);
  }
  </code></pre>