JDBC URL for file database

238 views
Skip to first unread message

Wes Clark

unread,
Jun 30, 2015, 8:53:04 PM6/30/15
to h2-da...@googlegroups.com
I'm using the tip of your nightly builds as of about two weeks ago.  I can run in mem mode, but when I try to run in file mode with a URL of either

  jdbc:h2:/tmp/guidewire/ferrite/px;AUTO_SERVER=true;MODE=Oracle;CACHE_SIZE=131072;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000

or 

  jdbc:h2:file:/tmp/guidewire/ferrite/px;AUTO_SERVER=true;MODE=Oracle;CACHE_SIZE=131072;DB_CLOSE_DELAY=-1;LOCK_TIMEOUT=10000

Did the specification of the location of the a file-mode database change in the last few years.  We've been using an old version for quite a while.  Both of the URLs generate 

  JdbcSQLException: A file path that is implicitly relative to the current working directory is not allowed in the database URL.  Use an absolute path, ~/name, ./name, or the baseDir setting instead.

Noel Grandin

unread,
Jul 1, 2015, 3:07:55 AM7/1/15
to h2-da...@googlegroups.com
Hi

What version of Java is this? And what operating system (and version thereof) ?

And can you run a quick small test program on this system using this version of java that does:

System.out.println(new java.io.File("/tmp/guidewire/ferrite/px").isAbsolute());
System.out.println(new java.io.File("\\tmp\\guidewire\\ferrite\\px").isAbsolute());

Thanks, Noel
> --
> 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 <mailto:h2-database...@googlegroups.com>.
> To post to this group, send email to h2-da...@googlegroups.com <mailto:h2-da...@googlegroups.com>.
> Visit this group at http://groups.google.com/group/h2-database.
> For more options, visit https://groups.google.com/d/optout.

Thomas Mueller

unread,
Jul 1, 2015, 8:13:04 AM7/1/15
to h2-da...@googlegroups.com
Hi,

On Windows, you would need to add the drive letter: c:/tmp/...

Regards,
Thomas

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-da...@googlegroups.com.

Wes Clark

unread,
Jul 1, 2015, 11:22:41 AM7/1/15
to h2-da...@googlegroups.com
Adding "c:" to the start of the file specification worked.  That is a change from the old 1.2 behavior?

Thomas Mueller

unread,
Jul 9, 2015, 12:04:43 PM7/9/15
to h2-da...@googlegroups.com
Hi,

Adding "c:" to the start of the file specification worked.  That is a change from the old 1.2 behavior?

Yes. The problem was that many people used non-absolute paths by mistake, for example "jdbc:h2:test", then started the process that opens the database with different working directories (for example the H2 Console from /programs/h2, and their application from /programs/acme), and so got multiple databases (one file /programs/h2/test.h2.db, one file /programs/acme/test.h2.db).

Regards,
Thomas

Wes Clark

unread,
Jul 9, 2015, 6:53:12 PM7/9/15
to H2 Database
I just sent you a private email with a link to the file.  Let me know you received it.

--
You received this message because you are subscribed to a topic in the Google Groups "H2 Database" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/h2-database/22DUq84Pp9Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to h2-database...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages