tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Schuerig <mich...@schuerig.de>
Subject Running HSQLDB in-process?
Date Sun, 24 Oct 2004 22:13:48 GMT

I'm trying to run HSQLDB in in-process mode in a web application. For 
this I've added a resource definition to the context file:

  <Resource name="jdbc/verzeichnisdb" auth="Container"
   type="javax.sql.DataSource" username="sa" password=""
   driverClassName="org.hsqldb.jdbcDriver"
   url="jdbc:hsqldb:file:/WEB-INF/db/verzeichnisdb;ifexists=true"
   maxActive="3" maxIdle="2"/>

No problem so far. But there is a problem, when HSQLDB tries to open the 
database and can't find it:

    java.sql.SQLException: Database does not exists:
    file:/WEB-INF/db/verzeichnisdb

Now, what I need is some hook where I can resolve this to an absolute 
path. Unfortunately, what looks like an ordinary file-URL isn't one. 
That is, AFAICT, it wouldn't help to resolve this to a jndi-URL (I 
think that's what Tomcat does). If my understanding is correct, I need 
an absolute file-URL as HSQLDB interprets the URL scheme to decide how 
to access the database (server, file in-process, in-memory).

As a last resort, I could run HSQLDB as a server and be done with it. 
But as only my single web app is using the DB there's no independent 
reason to do this.

Michael

-- 
Michael Schuerig                 Not only does lightning not strike
mailto:michael@schuerig.de       twice, it usually doesn't strike once.
http://www.schuerig.de/michael/  --Salman Rushdie, Fury

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org


Mime
View raw message