According [H2 Database Tutorial](
[To see links please register here]
) you can run the H2 Database in three different modes:
1. Server mode:
`jdbc:h2:tcp://localhost/~/test`
When using H2 db in server mode (also known as client/server mode) all data is transferred over TCP/IP. Before application can use H2 Database in server mode, you need to start the H2 DB within the same or another machine.
2. Embedded mode:
`jdbc:h2:~/test`
H2 db in embedded mode will be faster but the downside of it is that no other process can access the Database. In the above connection string, the Data will be saved into the ‘test’ folder, under the user’s home directory.
3. Mixed mode:
The mixed mode combines some features of the embedded and the server mode. The first application connecting to the H2 db does that in embedded mode, but at the same time it starts a server so that other applications can concurrently access the same data, even from different processes.
`jdbc:h2:/data/test;AUTO_SERVER=TRUE`
When using automatic mixed mode, you can share the JDBC URL for all applications using the DB. By default the server uses any free TCP port. The port can be set manually using AUTO_SERVER_PORT=9090.