Integrate an H2 Database in Your Spring Boot App
You have created a Spring Boot application and would like to integrate with an H2 database. What do you do?
Join the DZone community and get the full member experience.Join For Free
In this tutorial, we will be integrating the H2 database in your Spring Boot application. Note that the H2 database is in the embedded mode.
You have created a Spring Boot application and would like to integrate with an H2 database.
In pom.xml, add the below dependency:
<!-- H2 Database -->
In the application.properties file, add the below line to enable the H2 database:
Take a Maven build and run the application as a Spring Boot app.
Open a browser and type http://localhost:8080/h2 to get the below image.
The yellow highlighted lines should match your application.properties file.
That's it! If you get stuck, kindly comment below.
Published at DZone with permission of Jose Praveen, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.