Skip to content

manong-detective/java8-springboot-data-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%