john.mount (79) [Avatar] Offline
#1
When using 1.4 (or newer) versions of the H2 database you must make sure the path to the database files (part of the database "uri" key in the db definition XML file) is an "absolute path" starting with ".", "/", or "~". This was not an enforced requirement for the 1.3 version of the jar (which we used when writing the book). The thing to do is to check files like dbDef.xml and make sure they look like the following:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd">
<properties>
<comment>testdb</comment>
<entry key="user">u</entry>
<entry key="password">u</entry>
<entry key="driver">org.h2.Driver</entry>
<entry key="url">jdbc:h2:./H2DB;LOG=0;CACHE_SIZE=65536;LOCK_MODE=0;UNDO_LOG=0</entry>
</properties>

the change is the key="url" filed changed from "jdbc:h2:H2DB;..." to "jdbc:h2:./H2DB;...".

A similar change is needed in forming connection URLs from R. We have updated the code listings and added this to errata to try and save readers some trouble going forward.