I have an api rest application with an h2 database where I store a user model. Everything works great when I launch my application directly via intellij or grace mvn spring-boot:run but when I launch the .jar of my application my h2 database looks empty. Maybe I forget a property in my application.properties or something else. Do you have any idea what the problem is and how to fix it?
there is my application.properties :
spring.datasource.url = jdbc:h2:mem:Users
spring.h2.console.enable=true
management.security.enable=false
and my data.sql file :
INSERT INTO user(firstname,lastname, cash, username, password) VALUES('Cristiano' , 'Ronaldo' , 150.5 , 'cr7' , 'realmadrid');
COMMIT;