Spring boot courses - database choice for install

Maybe it would be lighter-weight on PC resources to use the H2 in-memory database instead of MySQL. But I’m not sure, maybe that’s a bad idea, if I’ll run into problems if I try it. On the other hand if the database engines are interchangeable under JPA why not? I don’t know to what extent JPA makes them perfectly compatible especially with respect to the course material ahead.

Hi.

That stuff is too old for me but take these as possible tracks to follow :

  • DB connection in the Java world is dealt with JDBC
  • You can very likely use any DB engine as soon as there is a driver for it

So if you believe it is preferable to you t o use an In-Memory DB, just go ahead. You’ll likely need to seed the data upon every startup, though. This is why MySQL is often a preferable way in most cases. In-Memory DB are mostly used to keep configuration but nothing prevents you to give it a go for the sake of following a course.

I became a .NET dev after my Java training so I hardly ever (not to say never) touched it since I completed it.

Just did a quick search.
It seems you just need to add a dependency to make it work.
They don’t seem to say where to put any modification (maybe part of a larger tutorial)

https://www.baeldung.com/spring-boot-h2-database

But deps looks like a Maven thing so pom.xml file or something.pom file.

Good luck.

EDIT: Actually it seems H2 can persist too.