• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Knute Snortum
  • Henry Wong
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Joe Ess
  • salvin francis

make a data base with H2 spring boot

Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everybody :

i learning spring boot , right now i m  trying to make a database using the spring boot h2 dependency , but the data base does n t show itself in the console as below :
here's the code in  /models/AppUsers.java :

i added also  the dependencies h2 and jpa in maven project :

here s my controller in /controllers/MainController.java/

also the cose inside the default file

and finally the view inside the /webapp/WEB-INF/jsp/index.jsp

i tried hard to  show the db in the url /localhost:8080/console , but anything doesn t work , should i add something else in order to  complete the code .
Ranch Hand
Posts: 1778
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Do you have a main class like this:

Do you have application.properties file under resources directory with these properties as the following?

If you are using embedded h2 database, don't need to specify spring.datasource.url, spring.datasource.driverClassName ...

Try to run the MyApplication class to start spring boot first. And then access http://localhost:8080/console and see.
Do not threaten THIS beaver! Not even with this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!