I have Created a Property file and stored in root Folder. (java Web project, servlet)
Code:
Properties prop = new Properties();
try {
prop.setProperty("EPU", "A1,A2,A3,A4,A8,A9,B1,B2,B3,B8,B9");
//save properties to project root folder
prop.store(new FileOutputStream("dbsc.properties"), null);
} catch (IOException ex) {
}
and the property file created successfully in the below path
Project ->Project Name ->dbsc.properties
then i want to read (load) this property file, code below
prop.load(new FileInputStream("dbsc.properties"));
when i executed received a FileNotFoundException
java.io.FileNotFoundException: kindcode.properties (The system cannot find the file specified)
My Question:
Is it correct procedure and path to save the property file?
how can i load the property file?