Bob M <[email protected]> writes:

> Hi
>
> It seems that I do NEED to delete this temporary folder before each opening
> of the database
>
> As I am very unsure of derby coding would somebody care to suggest what I
> need to add and where to add it?

Hi Bob,

Since Derby fails because it is not able to access the tmp directory, I
think it's likely that your likely that your application will run into
the same problems when trying to delete it, so it might be better to see
if you can find out why it cannot be accessed and fix the underlying
problem.

I would first have checked the permissions of the tmp directory and the
database directory to see if there's something there that prevents the
application from accessing the directory.

I'm assuming that if you add the following to your application

  File f = new File("C:/Program Files/Derby Database/us_copiosus/tmp");
  System.out.println(f.list());

it will print null (since that's essentially what Derby does when it
gets the NPE). That doesn't tell us much about why the directory cannot
be accessed, though. Using NIO to access the directory might provide you
with an IOException that has more details. For example, you could add
this line and see if/how it fails:

  java.nio.file.Files.newDirectoryStream(f.toPath());

Hopefully, that will give you some clues.

-- 
Knut Anders

Reply via email to