Hey Michael,
I think you can used ${catalina.base} or other system env variables inside server.xml and context.xml
for an absolute path information. Only problem with this handling is, don't save your server.xml oder context.xml
with the admin application.
Tipp: use a db resource path outside your application, than deployer can delete all
files without you lose the data! ;-)
hope it works, Peter
Michael Schuerig schrieb:
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
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]