SPRINGBOOT H2 DATABASE | DATA PERSISTENCE | SAVE TABLE RECORDS H2 | SPRINGBOOT H2 DB | OKAYJAVA
New Sample project
Application.proerties file
Persist data in file
Create a folder on c:// with name h2db
H2 will automatically create my_data_file
spring.datasource.url=jdbc:h2:file:C:/h2db/my_data_file
# spring.datasource.url = jdbc:h2:mem:h2db
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
# Run data.sql and schema.sql on start
spring.sql.init.mode=always
# spring.jpa.show-sql=true
# enabled by default.
spring.jpa.open-in-view=false
# Enable H2 Console -
spring.h2.console.enabled=true
# Console path -
spring.h2.console.path=/h2
# Whether to enable trace output.
spring.h2.console.settings.trace=false
# Whether to enable remote access.
spring.h2.console.settings.web-allow-others=false
Смотрите видео SPRINGBOOT H2 DATABASE | DATA PERSISTENCE | SAVE TABLE RECORDS H2 | SPRINGBOOT H2 DB | OKAYJAVA онлайн без регистрации, длительностью 09 минут 25 секунд в хорошем hd качестве. Это видео добавил пользователь okay java 26 Апрель 2020, не забудьте поделиться им ссылкой с друзьями и знакомыми, на нашем сайте его посмотрели 7 тысяч раз и оно понравилось 70 людям.