0

I open up an embedded database for test and can access through the browser, similar to PHPMyAdmin. I'm typing in the JDBC URL into IntelliJ to establish a connection to the database with the credentials in my application.properties, but getting a connection failure.

Properties

spring.datasource.url=jdbc:h2:file:~/test
spring.h2.console.settings.web-allow-others=true
spring.datasource.username=admin
spring.datasource.password=admin
spring.datasource.driver-class-name=org.h2.Driver
spring.jpa.hibernate.ddl-auto=create-drop

My question is, what is the correct way to establish a connection to an embedded database outside of the web console?

Ryan S
  • 155
  • 2
  • 16

1 Answers1

0

What you need is starting the TCP server which could handle the request from JDBC client.

For spring boot, the solution could be found in other questions. For example: https://stackoverflow.com/a/43276769

Beck Yang
  • 3,004
  • 2
  • 21
  • 26