Spring H2 Support: Difference between revisions
Jump to navigation
Jump to search
Line 21: | Line 21: | ||
<syntaxhighlight lang='text'> | <syntaxhighlight lang='text'> | ||
spring.datasource.url=jdbc: | spring.datasource.url=jdbc:h2:tcp://localhost/mem:default | ||
spring.datasource.username= | spring.datasource.username=sa | ||
spring.datasource.password= | spring.datasource.password= | ||
spring.datasource.platform=h2 | |||
spring.datasource.initialization-mode=always | |||
spring.jpa.hibernate.ddl-auto=none | |||
spring.jpa.show-sql=true | |||
</syntaxhighlight> | </syntaxhighlight> | ||
Revision as of 06:15, 19 October 2018
Internal
Overview
Dependencies
dependencies {
implementation('org.springframework.boot:spring-boot-starter-data-jpa')
runtimeOnly('com.h2database:h2')
}
Spring Configuration
Add in application.properties or equivalent:
spring.datasource.url=jdbc:h2:tcp://localhost/mem:default
spring.datasource.username=sa
spring.datasource.password=
spring.datasource.platform=h2
spring.datasource.initialization-mode=always
spring.jpa.hibernate.ddl-auto=none
spring.jpa.show-sql=true