https://start.spring.io/

In Memory
spring.datasource.url=jdbc:h2:mem:testdb
#spring.datasource.url=jdbc:h2:file:~/test
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Enabling H2 Console
spring.h2.console.enabled=true
# Custom H2 Console UR
#spring.h2.console.path=/h2-console
# Whether to enable trace output.
#spring.h2.console.settings.trace=false
# Whether to enable remote access.
#spring.h2.console.settings.web-allow-others=false
http://localhost:8080/h2-console


File DB
#spring.datasource.url=jdbc:h2:mem:testdb
spring.datasource.url=jdbc:h2:file:~/test;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=password
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect


Connect with DBeaver

Edit Driver Settings



Other related properties
spring.jpa.show-sql=true
spring.jpa.generate-ddl=true
spring.jpa.hibernate.ddl-auto=update
#spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5Dialect
#spring.jpa.properties.hibernate.type=trace
#spring.jpa.properties.hibernate.show_sql=true
#spring.jpa.properties.hibernate.format_sql=true
#spring.jpa.properties.hibernate.use_sql_comments=false
## default connection pool
spring.datasource.hikari.connectionTimeout=20000
spring.datasource.hikari.maximumPoolSize=5
#spring.datasource.hikari.connection-test-query=SELECT 1
#spring.datasource.hikari.minimum-idle=5
#spring.datasource.hikari.maximum-pool-size=20
#spring.datasource.hikari.idle-timeout=600000
#spring.datasource.hikari.max-lifetime=1800000
#spring.datasource.hikari.auto-commit=true
#spring.datasource.hikari.poolName=SpringBoot-HikariCP