I am trying to use h2 database. Normally i used MySQL and ther is no problem but in h2 database not working in many to one . I couldn connect h2 console.
h2-console error Error
Database "C:/Users/furka/test" not found, either pre-create it or allow remote
database creation (not recommended in secure environments) [90149-200] 90149/90149 (Help)
application.properties
#This part for H2 Database
server.port=8090
spring.datasource.url=jdbc:h2:mem:test
spring.datasource.driverClassName=org.h2.Driver
spring.datasource.username=sa
spring.datasource.password=
spring.jpa.database-platform=org.hibernate.dialect.H2Dialect
#enabling the H2 console
spring.h2.console.enabled=true
All code here: https://github.com/Furkan-Ahmet-Ozdemir/Spring-vet
CodePudding user response:
Add the JDBC dependency:
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-jdbc</artifactId>
</dependency>
CodePudding user response:
Try replacing
spring.datasource.url=jdbc:h2:mem:test
with
spring.datasource.url=jdbc:h2:tcp://localhost/~/test
in your application.properties