1

I'm using Geonetwork 2.10.3. I have all needed files and i want to connect to h2 database in NetBeans, so I could add new language. Howerver, I can't connect to h2. I have followed these steps:
1. In Services tab, Right-Click on Databases and click New Connection;
2. In new window, in in padded menu, i have chosen New Driver and added .jar file from lib folder named h2-1.3.152.jar, and then Next;
3. I have typed user and pass in fields, url fieled has been filled with jdbc:h2:, and then Next.

After that, it throws me exception:
Cannot establish a connection to jdbc:h2:  using org.h2.Driver (IO Exception: "java.io.FileNotFoundException: C:\Program Files\NetBeans 8.0.2\ .lock.db (The filename, directory name, or volume label syntax is incorrect)"; "C:\Program Files\NetBeans 8.0.2\ .lock.db" [90031-152]).
How can i solve this?

1

This is a file right issue. H2 cannot create the lock file in the specified folder. You have to specify a file for the database stored in a folder that does not require administrator rights. "C:\Program Files\NetBeans 8.0.2\" is usually protected by windows.

Solution, specify an url relative to user folder:

jdbc:h2:~/test

See https://stackoverflow.com/questions/9461770/where-does-h2s-embedded-databases-store-the-data

Note: This question is not related to H2GIS.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.