Project

General

Profile

H2 remote connection to database with AUTO_SERVER mode

Added by Komorek, Kamil about 5 years ago

Even using AUTO_SERVER switch in H2 database:

jdbc:h2:~/testdb;AUTO_SERVER=TRUE;MORE_OTHER_PARAMS...

I could not connect to it getting "Database may be already in use".
I've used connection string:
jdbc:h2:~/testdb

Solution is to use also AUTO_SERVER=TRUE on remote/client side, below connection string allows to connect without errors.

jdbc:h2:~/testdb;AUTO_SERVER=TRUE

I'm not sure does other params are necessary, but AUTO_SERVER is mandatory.


Comments