How to access *.mv.db file of H2 database?

45.1k views Asked by At

I have created database with my own program and it appeared as mydatabase.mv.db file.

But when I tried to access the same database with DbVisualizer, with apparently same parameters, it created two files mydatabase.lock.db and celebrity.h2.db and didn't see tables, created in the program.

What was the incompatibility?

UPDATE

both setups are follows:

enter image description here

enter image description here

3

There are 3 answers

4
Thomas Mueller On BEST ANSWER

In H2 version 1.3.x, the database file <databaseName>.h2.db is the default. (The storage engine "PageStore" is used).

In H2 version 1.4.x, the database file <databaseName>.mv.dbis the default. (The storage engine "MVStore" is used). The MVStore is still beta right now (November 2014). But you can disable the MVStore by appending ;mv_store=false to the database URL.

0
Tom Bollwitt On

The accepted answer is now several years old and since others may be looking for a more "current" solution...

To get it to work just update the H2 JDBC driver that DBVizualizer uses. Basically download the "Platform-Independent Zip" from http://www.h2database.com/html/download.html and copy the h2/bin/h2-X.X.X.jar file to ~/.dbvis/jdbc/ and then restart DBVizualizer so it can pick up the updated driver.

Also, make sure you remove .mv.db from the file name when setting the Database file name in DBVizualizer.

0
ajit peshane On

For Windows Users: The excellent way to read a *.db.mv file would be locally installing the h2 database and then running that database locally with the java command. Then your path to the file will definitely show the data from your table until and unless any errors occur.

You can download the h2 database form: http://www.h2database.com/html/download-archive.html Note: choose the database version for H2 which supports your file. You can install the H2 database by installing the downloaded .exe file would be around 7 MB.

then in the bin directory of H2 open a command prompt and run the command java -jar in my case it is

command: java -jar h2-1.4.200.jar

It will show the console of the H2 database on the browser

Provide the database details: Driver Class: org.h2.Driver JDBC URL: jdbc:h2:~/h2 "file path" User Name: "blank by default" Password: "blank by default"

Refer SS below enter image description here