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.
Any Ideas?
Insert self serving signature here.
Scott R.
Greenhorn
Joined: May 25, 2006
Posts: 2
posted
0
I fix the properties file problem. M
My question is now does the sandbox that JWS runs in allow you to connect to an Oracle database with JDBC?
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..