Create h2 database with Spring Boot if it not exists, then don't delete. Desktop application -


i writing desktop applicaiton, requires language dictationary.

i want application create h2 database when user first time run application, , load translations db .xdxf dictationary.

after quick looking through few articles got common use case create new schema every time when application starts , destroy on exit. did correctly?

is there way keep created schema after application stopped?

p.s. link suitable tutorial enougth me. thanks.

you referring spring boot by default. can configure in many ways, reading documentation should help.

h2 can configured in many ways, including file-based persistence (i.e. surviving restart of application).

with current setup works h2 in memory, give configuration try , @ doc remaining pieces:

spring.datasource.url = jdbc:h2:file:~/testdb 

we figure out driver based on url. note since took control on setup, hibernate won't configured create schema automatically on startup (if relying on that). check this question more details.


Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -