In the web application, which I am going to build, I need some SQL queries, which I can store in a properties file, and get them into my Java code, and then execute.
I have found many suggestions on the internet, but nothing helped me. Some of them are
this.getClass().getClassLoader().getResourceAsStream("resources/file.properties");
this.getClass().getResourceAsStream("resources/file.properties");
I have kept the properties file in resources, and in the same directory in which my Java file is present. Nothing worked. I am using Eclipse and Struts2.