ForestG
ForestG

Reputation: 18123

IntelliJ IDEA, Cannot connect to Embedded H2 database: "Error while creating file"

I have a working embedded H2 database (..mv.db), which I cannot connect to from IntelliJ IDEA.

The credentials are the same as the Spring application.properties which uses it, but from the built-in Database tool in IntelliJ Idea I get this strange error upon connecting (or Testing the connection):

[90062][90062] Error while creating file "C:/Program Files (x86)/IntelliJ IDEA 2020.1.2/bin/data" [90062-200].

enter image description here

I have zero clue how to solve this, couldn't find any resource about this problem. My Sping application connects easily (I shut it down before trying to access the same file).

Upvotes: 0

Views: 1263

Answers (1)

Evgenij Ryazanov
Evgenij Ryazanov

Reputation: 8188

You need to use the absolute path to database in JDBC URL. Relative path ./data/database/something in your application and in your IDE are resolved into different directories, because your application and your IDE have different current working directories for oblivious reasons.

Upvotes: 2

Related Questions