Konrad Garus Konrad Garus - 1 year ago 96
Java Question

Where are my H2 database files?

I'm just evaluating the H2 database... I downloaded and unpacked the installation and connect to a database at

is my home dir,
does not exist (I expect H2 to create it).

The console seems to work OK. I created a table and inserted a row to it. Even if I disconnect and reconnect the console, I can see and query the table.

However, I don't see the file I expected. Where is it?

Answer Source

Are you sure there is no:


file? If not, try this:

$ lsof -p `jps -ml | grep h2 | cut -d' ' -f1` | grep \.h2\.db$

What it does is it look for Java process of H2 console, grabs its PID and lists all open files of that process, filtering by H2 database extension. Of course you can use PID of any other Java process accessing this DB. If it is persisted on the disk, you can't miss it.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download