Stanley Bradbury wrote:
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?
Hi -
For embedded Derby to work properly it needs to be loaded high in the
classloader hierarchy of the server. As far as I know this cannot be
done by an application, the application layer has too many
restrictions and Derby is designed to be a shared resource. Sharing
Derby is done by integrating Derby with Tomcat as described in the
JPetStore write-up at:
http://db.apache.org/derby/integrate/DerbyTomcat5512JPetStor.html
I believe that Derby in client/server architecture might be your only
choice if you cannot get Derby embedded as a global resource at the
Server level.
I've made it a staticly accessible resource. I use my own database
management container, the DataSource container for tomcat has been too
heavy for my needs. I've also set it up in Spring successfully.
Paul