Intellij IDEA and H2 DB file recognition problem


Hi, i have little problems with my IntelliJ config. I am creating project using H2 1.4.192 version  as embedded data source. So H2 since version 1.4.X storage as default data in file with extension .mv.db. First my problem is that my database tool don't recognize this type of data source. I can only add H2 data source with extension *.h2.db. My question is how can i fix it. The next problem how can i set file with this extension (.mv.db) to be recognized by intellij as Data Source. Files with extension *.db everything works fine. I looked for a solution in file types option tab, but there is not in "Recognized File Types" Data Source option.

Comment actions Permalink

Hello Peter,

When you enter connection URL in for H2 Data Source correctly everything should work without need to additionally configuring any extensions in IDE. What connection settings are you specifying? Thanks.

Comment actions Permalink

I configured my data source in persistence.xml files. To be exact i have 2 persistence.xml one configured in test purpose with H2 and one with postgresql. The data source (H2) in intellij looks like this (this is the file and i cannot do anything with this) :


persistence.xml in test directory:

Comment actions Permalink

Sorry for delayed reply.

>this is the file and i cannot do anything with this

When I added persistence.xml with persistence-unit from the gist and re-opened the project - IDE discovered new Data Source and offered to create it in the project:

There was an issue with the file path in the created data source, though, which I had to correct to a full path (this is due to this bug ). After specifying full path to a file it works for me:

Could you please check if it works for you? Thanks.

Comment actions Permalink

I did in the way you said. It works but not completly. Check this out:


After this if you checkout db folder you see something like this:


IntelliJ instead connecting to create new data source test.h2.db.  So it even from persistence.xml refuse to create db with appropriate extension. (don't pay attention to test.trace.db it is a file not connected with this problem - bug in code).



Found source of the problem. I had in maven dependency the newest version of H2 DB but in Data Source Manager driver wasnt up to date version. After i downloaded the newest IntelliJ connected to But still intelliJ doesn't recognize as Data Source but as unknown file. It is not comfortable to switch persistence.xml file in module option only to add Data Source. Thanks for your help ;)


Comment actions Permalink

Thanks for the information! I've filled two enhancement requests, please feel free to vote and follow them:


Please sign in to leave a comment.