Hi
I have a properties file access.properties and i try to add something to
this empty file. I use this code :
Properties properties = new Properties();
try {
properties.load(new FileInputStream("access.properties"));
} catch (IOException e) {
System.out.println(e.getMessage());
}
properties.setProperty("/db","1");
try {
properties.store(new FileOutputStream("access.properties"), null);
} catch (IOException e) {
System.out.println(e.getMessage());
}
but it isnt work file is still empty 0 exceptions why??
Marcin Goldyn
david bydefault - 19 Jun 2005 23:57 GMT
> but it isnt work file is still empty 0 exceptions why??
> Marcin Goldyn
Are you using a IDE? If you are compiling and running from the console,
it should work. Otherwise, maybe you are not looking at the folder where
the IDE runs the code.
Wendy Smoak - 20 Jun 2005 00:03 GMT
> I have a properties file access.properties and i try to add something to
> this empty file. I use this code :
>
> but it isnt work file is still empty 0 exceptions why??
Your code worked fine for me. Where is your access.properties file located?
Are you sure you have write permission down to the directory and on the file
itself?

Signature
Wendy Smoak
Marcin Go³dyn - 20 Jun 2005 09:33 GMT
Hi
I`m stupid. Of course file is stored in my main IDE catalog.
forgive me this post. Thx for your advices and attention.
Marcin Goldyn