Java J2ME JSP J2EE Servlet Android

java : Wrtiting to a properties file

Let's consider a properties files named "conf.properties" with no content.
Suppose we need to add the following content to this file.
server=oracle
date.format=dd-mm-rrrr hh24:mi:ss

Then the java code for this would be..

Properties props = new Properties();
props.setProperty("server","oracle");
props.setProperty("date.format","dd-mm-rrrr hh24:mi:ss");
try{
  props.store(new FileOutputStream("config.properties"), null);
}catch(IOException e){
}