Access to the H2 Database
External Database access for H2 can be granted on different ways. Teedy stores its H2 database in standard path /var/docs/db
Variant 1: Download H2 Database Tool
- Download → http://www.h2database.com/h2-2019-03-13.zip
- Put your database copy/backup files (docs.mv.db and dovs.trace.db) into some directory where you can access it
- Use it
Run the h2.bat file and connect via Web Interface, or
Connect via Console (Windows)
cmd
cd C:\Users\mario\Downloads\h2-2019-03-13\h2\bin
#note: ignore the *.db ending. H2 will add it automatically. If you do it yourself it will fail!
java -jar h2-1.4.199.jar -url "jdbc:h2:file:~/Downloads/docs;CACHE_SIZE=65536;LOCK_TIMEOUT=10000;IFEXISTS=TRUE;" -driver "org.h2.Driver" -user "sa" -password ""
Connect via Console (Linux)
Good tips: https://o7planning.org/en/11895/installing-h2-database-and-using-h2-console
cd opt/
wget https://h2database.com/h2-2019-03-13.zip
unzip h2-2019-03-13.zip
rm h2-2019-03-13.zip
cd /opt/h2/bin/
#open Database with h2 driver - enable X11 forward to recieve graphical user interface (GUI)
export DISPLAY=localhost:10.0 && java -jar h2-1.4.199.jar -url "jdbc:h2:file:/var/docs.bak/db/docs;CACHE_SIZE=65536;LOCK_TIMEOUT=10000;IFEXISTS=TRUE;" -driver "org.h2.Driver" -user "sa" -password ""
#note that version h2-2019-10-14 failed on the Teedy H2 database. So i used older version h2-2019-03-13
Variant 2: DBVisualizer
DBVisualizer comes with bundled support for H2 including the driver → https://www.dbvis.com/features/h2-database-features
Some example configuration looks like this:
Ignore the *.db
ending. H2 will add it automatically. If you do it yourself it will fail! So the database "docs" contains of two files and you only need to enter the principal name.
Keine Kommentare