You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Ernesto Reig <er...@gmail.com> on 2007/02/16 11:42:24 UTC

datasources

Hi all.
One of the use case of my web app is to allow users to create new
datasources. So in my web app I have a form to create the new datasource.
One of the fields of the form is a input file type, where the user loads the
datasource driver jar. The other fields are used to get the values of the
properties that this datasource will have in web.xml and context.xml. So in
my web app I parse (using jdom) both xml's to create new nodes
(datasources), and to update both files.
And the question is:
 - Do I need to restart Tomcat in order that new created datasources be
available??
 - If yes (or not), is there some way to create new datasources (updating
web.xml and context.xml) and to be available at once, that is, without
restarting tomcat??

Thnx in advance.

RE: datasources

Posted by "Caldarale, Charles R" <Ch...@unisys.com>.
> From: Ernesto Reig [mailto:ernirulez@gmail.com] 
> Subject: datasources
> 
>  - Do I need to restart Tomcat in order that new created 
> datasources be available??

Tomcat's admin app can create datasources on the fly; you might want to
take a look at how that's done.

 - Chuck


THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY
MATERIAL and is thus for use only by the intended recipient. If you
received this in error, please contact the sender and delete the e-mail
and its attachments from all computers.

---------------------------------------------------------------------
To start a new topic, e-mail: users@tomcat.apache.org
To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org
For additional commands, e-mail: users-help@tomcat.apache.org


Re: datasources

Posted by Mikolaj Rydzewski <mi...@ceti.pl>.
Ernesto Reig wrote:
> One of the use case of my web app is to allow users to create new
> datasources. So in my web app I have a form to create the new datasource.
> One of the fields of the form is a input file type, where the user 
> loads the
> datasource driver jar. The other fields are used to get the values of the
> properties that this datasource will have in web.xml and context.xml. 
> So in
> my web app I parse (using jdom) both xml's to create new nodes
> (datasources), and to update both files.
> And the question is:
> - Do I need to restart Tomcat in order that new created datasources be
> available??
> - If yes (or not), is there some way to create new datasources (updating
> web.xml and context.xml) and to be available at once, that is, without
> restarting tomcat??
Do you want your app to change it's web.xml / context.xml? I wouldn't 
call it a good approach.

If you want to create datasources on the fly, use JMX - you can play 
with http://www.ceti.pl/~miki/komputery/jmx/. But I'm afraid it will not 
work with user supplied jdbc jar files (different classloader).

Why don't you want to create datasources by hand? It's not so difficult.


-- 
Mikolaj Rydzewski <mi...@ceti.pl>