2

I was looking into derby database and found property which sets derby home directory.

Are there property in h2 database like to derby.system.home to set home directory?

michael nesterenko
  • 14,222
  • 25
  • 114
  • 182

1 Answers1

1

Yes, H2 supports the system property h2.baseDir, even thought I wouldn't actually recommend using it. Instead, I suggest to use either a hardcoded path in the database URL, such as jdbc:h2:/data/dbs/test or use a path relative to the user home directory, such as jdbc:h2:~/dbs/test.

Thomas Mueller
  • 48,905
  • 14
  • 116
  • 132
  • what is wrong with it? why cant I use it? from my perspective it is very useful – michael nesterenko Jul 22 '12 at 20:27
  • 1
    You can use it of course, but you need to remember to set it every time. If the setting isn't set, a different database is created in a different directory, which might be confusing. That's why I don't recommend to use the setting - is to avoid such problems. – Thomas Mueller Jul 23 '12 at 04:41