> I've noticed that when starting H2 as windows service, and accessing
> DB by url jdbc:h2:tcp://localhost/~/test , then database files are
> created in the root of drive C:. Is this correct behaviour?
When running the database as a service, absolute path should be used.
Using ~ in the database URL is problematic in this case, because it
means to use the home directory of the current user. The service
might run without or with the wrong user, so that the database files
might end up in an unexpected place.
> How could
> I change db files location, other then absolute path in the jdbc url?
You could set the baseDir in the configuration. Currently, this is:
wrapper.app.parameter.1=org.h2.tools.Server
wrapper.app.parameter.2=-tcp
wrapper.app.parameter.3=-web
I think the following should work. Could you try that and tell me if
it does? (I don't currently have a Windows machine available):
wrapper.app.parameter.1=org.h2.tools.Server
wrapper.app.parameter.2=-tcp
wrapper.app.parameter.3=-web
wrapper.app.parameter.4=-baseDir
wrapper.app.parameter.5=/data/h2
Regards,
Thomas