Dear All,
compliments. I have a hard time with URIs under Windows (simply because
I do not know this OS very well.)
In our own Java code, all URIs are defined as:
groovy> URI uri = new URI("file:/C:/Users/manticore/.manticore/ifrsbox");
groovy> File f = new File(uri);
Result: C:\Users\manticore\.manticore\ifrsbox <-- OK!
Based on that understanding, I would have specified the H2 connection
string as:
jdbc:h2:file:/C:/Users/manticore/.manticore/ifrsbox
But this gives me
General error: "java.nio.file.InvalidPathException: Illegal char <:> at index
2: /C:/Users/manticore/.manticore/ifrsbox" [50000-201] HY000/50000 (Help)
Instead, the following seems to work as H2 connection string:
jdbc:h2:file:C:/Users/manticore/.manticore/ifrsbox
jdbc:h2:C:/Users/manticore/.manticore/ifrsbox (wow!)
but fails as URI:
groovy> URI uri = new URI("file:C:/Users/manticore/.manticore/ifrsbox");
groovy> File f = new File(uri);
Exception thrown
java.lang.IllegalArgumentException: URI is not hierarchical
at java.io.File.<init>(Unknown Source)
at ConsoleScript11.run(ConsoleScript11:2)
Now I have two questions please:
1) is that a Bug or a Feature? (in my opinion,
"jdbc:h2:file:/C:/Users/manticore/.manticore/ifrsbox" was more logical than
"jdbc:h2:file:C:/Users/manticore/.manticore/ifrsbox" and especially
"jdbc:h2:C:/Users/manticore/.manticore/ifrsbox")
2) if it was a feature, then what would be the best way to get the DB File Name
from a Connection URL, given the three different Schemes like
"jdbc:h2:C:/Users/manticore/.manticore/ifrsbox",
"jdbc:h2:file:C:/Users/manticore/.manticore/ifrsbox" and
"jdbc:h2:tcp://localhost/C:/Users/manticore/.manticore/ifrsbox"
Thank you already and best regards
Andreas
--
You received this message because you are subscribed to the Google Groups "H2
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/h2-database/f5fa46ef649440a76650285583f54a2a869212f2.camel%40manticore-projects.com.