Discussion:
[h2] Open H2 Database from Classpath
Jack Green
2018-11-02 15:35:14 UTC
Permalink
Crossposting from StackOverflow as had no response -
https://stackoverflow.com/questions/53088525/open-h2-database-from-classpath

I've seen from the H2 documentation that you can open files on the classpath
<http://www.h2database.com/html/advanced.html#file_system>.

I've tried various URLs (e.g. jdbc:h2:classpath:/myDatabase) when opening a
connection, but none seem to find the resource - but when I try
MyClass.class.getClassLoader().getResourceAsStream("myDatabase") it can
find it it fine.

The database is on the classpath in src\test\resources.

Any ideas what I'm doing wrong?
--
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 h2-database+***@googlegroups.com.
To post to this group, send email to h2-***@googlegroups.com.
Visit this group at https://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.
Continue reading on narkive:
Search results for '[h2] Open H2 Database from Classpath' (Questions and Answers)
3
replies
Required Java syllabus?
started 2007-07-25 22:08:10 UTC
programming & design
Loading...