I am trying to run my swing app which connects to an oracle database. It gets the database values (sid, port, etc) from a .properties file. I instantiate a new properties object and then try to load the .properties file from the jar as follows.
Properties p = new Properties(); try { p.load(getClass().getResourceAsStream("properties/database.properties")); } catch (IOException ex3) { System.out.println("IO Error"); }
p.load(InputStream) is recieving a null value and thus not able to collect the database values I need.
I have used jar -tf to make sure the properties file is in the jar and it reads back:
MyPackage/properties/database.properties
I have also tried using the classloader from previous posts but to no avail.
I had similar problem where I was loading application specific properties file by using Properties class. It failed. For now, I am passing it as the input arguments to the main method by using the JNLP file. I am just curious, how did you fix your problem?
Hi Balachandran, -------------------------------------------------------------------------- I had similar problem where I was loading application specific properties file by using Properties class. It failed. For now, I am passing it as the input arguments to the main method by using the JNLP file. I am just curious, how did you fix your problem? --------------------------------------------------------------------------
I'm stuckup with reading the input arguments in the main method of the JNLP file.... can u tell me more about how to read these values...if u can paste your class then it would be great..