The container usually sets up a datasource for you in JNDI, for tomcat 
you modify server.xml and in resin you modify resin.conf so that's 
outside your web application.  In your web.xml file you just define the 
<resource-ref...> to expose to your application and all you have make 
sure is that the JNDI names match in the container definition :).

So all you need to access a DB connection is fetch it from JNDI.  For 
your other settings? You go in and modify the exploded web application 
since the container does that anyway :).

danny

Kirby Vandivort wrote:

>Hello,
>
>I have been reading up on accessing databases from within the struts
>framework, and I'm not totally sure of the best way to approach the
>issue of deployment.
>
>We package up a WAR file for distribution to end users, and I would
>like to be able to tell them to drop the WAR file in webapps and be
>done with it.  (ie., not have to uncompress it).
>
>However, from what I can tell, setting up "clean" database access
>includes doing something like making a data-source entry and placing it
>in the web.xml in the WEB-INF directory of the deployed application.
>
>Since the properties for the database (username, password, etc) will be
>different for each end user, I can't apriori set values for this.
>
>So, what does everyone out there that has been down this road before do
>to solve this problem?  I guess, really, this goes beyond simple
>database access.  We also have a few other settings for our application
>that need to be set.
>
>CURRENTLY, we aren't using struts (pure servlets) and we have properties
>files that contain this information.  But, we are currently requiring
>the user to unpack the WAR file and I would love to get away from this.
>
>Thanks for your help!
>
>  
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to