使用h2时,
by default it will have the org.h2.Driver driverclass, which is the connection URL as jdbc:h2:mem:testdb and the username: sa and password: empty toconnect to the H2 engine.
The H2 engine offers a console where you can see all the tables and its data; however, this console is aweb application. So, what do you think you will need to get access to the H2 console? You are correct! Youneed to include the spring-boot-starter-web pom dependency to your pom.xml.
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
You also need to add the following property to the src/main/resources/application.properties file.
spring.h2.console.enabled=true
go to your browser andgo to http://localhost:8080/h2-console.