I want to deploy my Java Web Application with an internal H2 database on AWS. I creates application-prod.properties like:
server.port=5000
spring.datasource.url=jdbc:h2:./src/main/resources/data/demo
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
spring.h2.console.enabled=true
spring.h2.console.path=/h2-console
spring.h2.console.settings.trace=false
spring.h2.console.settings.web-allow-others=false
spring.h2.console.settings.trace=false
spring.jpa.hibernate.ddl-auto=none
I package my application as jar and load it up to elastic beanstack. But when I deploy, the database always disappear and I need to recreate the whole schema. I just want to use the internal h2 database for my sample application and I want to keep the data in the database file. Does anybody know how I can achieve this? My application is a spring boot application based on vaadin.
Thanks and kind regards,
Nullpointer