There are 2 ways to do this - without using Dev Tools and with using Dev Tools. We will see both ways
git clone [email protected]:101bits/springboot-data-example.git
cd springboot-data-example
git checkout tags/without_dev_tools
mvn spring-boot:run
This will start the application, import data (from import.sql
) and start the Tomcat
web-server.
On your choice of browser, enter http://localhost:8080/h2-console Enter the following for
JDBC URL: jdbc:h2:mem:testdb
User Name: sa
Pasword: <leave this empty>
Add the Spring-Boot Dev Tools dependency
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-devtools</artifactId>
<optional>true</optional>
</dependency>
That's it. There is no need to change anything in application.properties
. Follow the Login to the database section
and you would be able to connect to H2
database using a browser.