By my reading of the H2 documentation and some answers to similar problems, calling a URL like
"jdbc:h2:~/test;IFEXISTS=TRUE"
should
cause H2 to reconnect to the existing ~/test.mv.db. But every time I
attempt to read the existing data from the JVM application, H2 creates a
new ~/test.h2.db instead, and then (not surprisingly) fails with a
"Table not found" error:
I'm
using H2 with highly abstract code from the doobie library for Scala,
but I'm nearly certain the issue here is due to my inexperience with H2
and not anything on the Scala side.
FYI in case it makes any difference, my H2 JAR file is in a sub-subdirectory of ~/.
Evgenij Ryazanov
unread,
Nov 6, 2016, 3:26:25 AM11/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2 Database
If you started your database on H2 Server, you should use jdbc:h2:tcp://localhost/~/test as database URL on client side for Client/Server mode. Your URL suitable only for H2 Console and for embedded mode.
Anyway, this behaviour is strange. Is it possible that you have an older h2 jar somewhere in classpath of your application?
brink...@gmail.com
unread,
Nov 6, 2016, 7:18:05 PM11/6/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to H2 Database
This was in embedded mode. The H2 1.4.193 JAR I downloaded for this work is the only one I ever explicitly downloaded, although I have run numerous Play framework samples that included an embedded H2. FYI, I have never run an explicit install procedure for H2 -- just downloaded the jar, invoked included script for web client, and called in embedded mode from my project. I have no explicit CLASSPATH in env, and am not explicitly supplying any CLASSPATH argument when I run the project. This is on Ubuntu 16.04.
Noel Grandin
unread,
Nov 8, 2016, 3:09:05 PM11/8/16
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to h2-da...@googlegroups.com
that looks like you are using an old version of H2 in your application, which is opening a database based on the PageStore engine, hence the .h2.db file extension.
the web console is running a newer version, and is defaulting to the MVStore engine, hence the .mv.db file extension