try (BufferedReader rd = new BufferedReader(
new FileReader(getClass().getResource(fileName).getFile()))) {
prop.load(rd);
} catch (IOException ex) {
ex.printStackTrace();
}
I am trying to read a file named database.properties,which i have put in the resources directory that i defined in the eclipse build path.
i've tried passing all kind of arguments,nothing worked.The getResources always returns either null or file not found exception.
I am really confused.Can someone explain what is the problem and how does resources work in the eclipse?
Values i've tried passing as the fileName:
database.properties,/database.properties,/resources/database.properties and some others