db-derby-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stanley Bradbury <Stan.Bradb...@gmail.com>
Subject Re: Can I embedded Derby Dabase in Webapplication
Date Thu, 16 Feb 2006 17:42:41 GMT
Srinivasarao G wrote:

> Hi
> My requirement is , Can I embed Derby database as part of my web 
> application. That is, specific to web application. I shall copy 
> Derby.jar and derby tools.jar in webapps\win-inf\lib and then I want 
> derby to be started when I start webserver/app server  and use the 
> myproject.war to use derby database.
> anticipating reply.
> thanks
> vasu.

The integrations page on the Derby website has good information on using 
Derby in a J2EE server environment 
(http://db.apache.org/derby/integrate/index.html).  These recommend 
using a datasource to insure that Derby is loaded properly in any 
classloader hierarchy created by the Server.  For more info on this see 
the [i]General Integration Notes[/i] in the Tomcat paper.  Let me know 
if this helps.

My concern with your requirement is placing the derby jars in an 
application directory will restrict Derby to running within the 
application classloader - I know of no way to make this work.  The 
bottom line is that Derby should only be loaded once into any JVM.  It 
is a multi-user system and becomes a global resource within the JVM.  I 
am not a web-app programmer so do not know if setup the way you describe 
Derby can be loaded in an unisolated classloader above that in which the 
webapp is running.

View raw message