db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul J DeCoursey <p...@decoursey.net>
Subject Re: Embedded in Servlet on Tomcat?
Date Fri, 21 Jul 2006 15:46:21 GMT
Stanczak Group wrote:
> How does one get Derby embedded in a servlet under Tomcat. In my 
> development environment I'm using Netbeans and Tomcat. Tomcat install 
> is under root so I can't write to is, just my web modules directories. 
> I can connect to a path with Netbeans's database tool, but when I 
> launch the app on Tomcat I get errors that it can't create files like 
> createDD.jdbc and derby.log. I'm guessing this is because Derby is 
> showing it's home as the root of the Tomcat server.  The question is 
> why and how can I fix this? I have an absolute path set, but it still 
> does it. Shouldn't it write everything to that path and not just start 
> writing to where ever it decides home is?
I have encountered similar issues.  I also develop with Tomcat and 
Netbeans. I do not have issues with absolute paths however.  I let the 
servlet get me the path however, on the servlet init I get the 
ServletContext and call getRealPath("WEB-INF") to get my base directory 
for my database. I have init-params setup as well so I can reset this to 
a directory outside of the servlet context altogether.  Hope this gets 
you set in the right direction.


View raw message