What is the jdbc connection string for h2 database?

Change application.properties to the following:

spring.jpa.open-in-view=true

spring.datasource.url=jdbc:h2:mem:testdb

spring.datasource.driverClassName=org.h2.Driver

spring.datasource.username=sa

spring.datasource.password=

Set H2 Console to the following:

jdbc:h2:mem:testdb

As per documentation, default JDBC connection string is

jdbc:h2:~/test  

And, for TCP connection

jdbc:h2:tcp://localhost/~/test  

==Update==

But, if you wanted to create/read h2 database to/from specific folder, then it should be

 jdbc:h2:tcp://localhost/<path_to_database>

That means,

jdbc:h2:tcp://localhost/D:/myproject/data/project-name

Thanks @Sam for sharing info.