0

I am using a properties file that contains SQL queries for my DAOs.

I open it through a getResourceAsStream() method. However, this only works if the properties file is in the same package as the DAO classes.

What I have to do though is place it in a properties folder that should be in the same level as the WebContent folder.

I am using eclipse as an IDE. I noticed that when I have a main method I can access the file but not anymore when I am running an application.

Ryan Vincent
  • 4,483
  • 7
  • 22
  • 31
  • You may need to change your Project's source code to include the location of the properties file. See http://stackoverflow.com/questions/760756/how-do-you-make-getresourceasstream-work-while-debugging-java-in-eclipse – matt freake Jan 05 '16 at 16:22
  • you may need to have that file in your `classpath` for that you can either put it in your `resources` folder and make sure it is included in your build path as `src` folder or put it in some other folder and add it to your build path as `src` folder. – Sajjad Jan 05 '16 at 16:39

0 Answers0