Where are my H2 database files?

Your database files can be found in your user directory. For windows

C:\Users\<userName>

Take a look at H2's FAQ, You can find more information here

And in new versions of Spring, it's located simply in project root directory, like this :

spring boot db file location

And property is spring.datasource.url=jdbc:h2:file:./fileOrDbName


Are you sure there is no:

/home/konrad/test.h2.db

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.

Tags:

Java

H2