Skip to content

Latest commit

 

History

History
37 lines (30 loc) · 1.22 KB

README.md

File metadata and controls

37 lines (30 loc) · 1.22 KB

springboot-data-example

There are 2 ways to do this - without using Dev Tools and with using Dev Tools. We will see both ways

How to run without using Dev Tools

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.

Login to the database

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>

How to run using Dev Tools

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.

Blog link: https://medium.com/@harittweets/how-to-connect-to-h2-database-during-development-testing-using-spring-boot-44bbb287570