From the online docs at:
http://www.h2database.com/html/features.html
Memory-Only Databases
For certain use cases (for example: rapid prototyping, testing, high
performance operations, read-only databases), it may not be required
to persist (changes to) the data at all. This database supports the
memory-only mode, where the data is not persisted.
In some cases, only one connection to a memory-only database is
required. This means the database to be opened is private. In this
case, the database URL is jdbc:h2:mem: Opening two connections within
the same virtual machine means opening two different (private)
databases.
Sometimes multiple connections to the same memory-only database are
required. In this case, the database URL must include a name. Example:
jdbc:h2:mem:db1 . Accessing the same database in this way only works
within the same virtual machine and class loader environment.
It is also possible to access a memory-only database remotely (or from
multiple processes in the same machine) using TCP/IP or SSL/TLS. An
example database URL is: jdbc:h2:tcp://localhost/mem:db1 (using
private database remotely is also possible).
By default, when the last connection to a in-memory database is
closed, the contents are lost. This can be disabled by
adding ;DB_CLOSE_DELAY=-1 to the database URL. That means to keep the
contents of an in-memory database as long as the virtual machine is
alive, use jdbc:h2:mem:test;DB_CLOSE_DELAY=-1
Brish