You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@struts.apache.org by Legolas Woodland <le...@gmail.com> on 2005/12/26 20:27:17 UTC

what is diffrent between Struts Datasource and Tomcat datasource

Hi
thank you for reading my post.
we can define data-source inside Struts-config.xml
also it is possible to define a data-source in tomcat admin page.
no my question is :
what is differences between them , are they the same ?
Which requirement each of this data-source has ?



Thank you

Re: what is diffrent between Struts Datasource and Tomcat datasource

Posted by Craig McClanahan <cr...@apache.org>.
On 12/26/05, Legolas Woodland <le...@gmail.com> wrote:
>
> Craig McClanahan wrote:
> > On 12/26/05, Legolas Woodland <le...@gmail.com> wrote:
> >
> >> Hi
> >> thank you for reading my post.
> >> we can define data-source inside Struts-config.xml
> >> also it is possible to define a data-source in tomcat admin page.
> >> no my question is :
> >> what is differences between them , are they the same ?
> >> Which requirement each of this data-source has ?
> >>
> >
> >
> > >From the simplest possible perspective, one could say that the two data
> > sources are pretty much equivalent ... they both provide you with a
> > connection pool for sharing a small number of JDBC connections (to the
> same
> > underlying database) across all the incoming requests of your
> application,
> > without requiring you to allocate a request per user, even when that
> user
> > does not have an active request.
> >
> > In terms of recommended usage, though, you are strongly encouraged *not*
> to
> > use the Struts version ... use the connection pool provided by your
> servlet
> > container instead.  Struts 1.0 included the data source implementation
> > because, at the time, most servlet containers had no such support.  Now
> that
> > they all do, the Struts data source support was deprecated in 1.1, and
> > removed in 1.2.
> >
> > Craig
> >
> >
>
> Thank you for reply.
> If i want to use Tomcat Data-source , tomcat must have my jdbc driver in
> its shared lib folder (is it true?)


See the Tomcat documentation for precise requirements.  For example, if
you're using 5.5:


http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

if i do not use struts data-source , i it possible to use tomcat
> data-source without having access to change tomcat specific settings ?
> i mean : is it possible to include the data-source inside the war file
> descriptors ? for example web.xml , or context.xml ?
> *if im not mistaken we can put a context.xml inside meta-inf folder
> which will act like server context definition.


You can indeed do this (if your Tomcat environment is configured
appropriately):

  http://tomcat.apache.org/tomcat-5.5-doc/manager-howto.html

Your best bet on getting detailed help would be to ask questions about it on
the Tomcat user mailing list (to subscribe, send an empty message to <
user-subscribe@tomcat.apache.org>).

Craig

Re: what is diffrent between Struts Datasource and Tomcat datasource

Posted by Legolas Woodland <le...@gmail.com>.
Craig McClanahan wrote:
> On 12/26/05, Legolas Woodland <le...@gmail.com> wrote:
>   
>> Hi
>> thank you for reading my post.
>> we can define data-source inside Struts-config.xml
>> also it is possible to define a data-source in tomcat admin page.
>> no my question is :
>> what is differences between them , are they the same ?
>> Which requirement each of this data-source has ?
>>     
>
>
> >From the simplest possible perspective, one could say that the two data
> sources are pretty much equivalent ... they both provide you with a
> connection pool for sharing a small number of JDBC connections (to the same
> underlying database) across all the incoming requests of your application,
> without requiring you to allocate a request per user, even when that user
> does not have an active request.
>
> In terms of recommended usage, though, you are strongly encouraged *not* to
> use the Struts version ... use the connection pool provided by your servlet
> container instead.  Struts 1.0 included the data source implementation
> because, at the time, most servlet containers had no such support.  Now that
> they all do, the Struts data source support was deprecated in 1.1, and
> removed in 1.2.
>
> Craig
>
>   

Thank you for reply.
If i want to use Tomcat Data-source , tomcat must have my jdbc driver in 
its shared lib folder (is it true?)
if i do not use struts data-source , i it possible to use tomcat 
data-source without having access to change tomcat specific settings ?
i mean : is it possible to include the data-source inside the war file 
descriptors ? for example web.xml , or context.xml ?
*if im not mistaken we can put a context.xml inside meta-inf folder 
which will act like server context definition.


Thank you again for reply.
*
> Thank you
>   
>>     
>
>   


Re: what is diffrent between Struts Datasource and Tomcat datasource

Posted by Craig McClanahan <cr...@apache.org>.
On 12/26/05, Legolas Woodland <le...@gmail.com> wrote:
>
> Hi
> thank you for reading my post.
> we can define data-source inside Struts-config.xml
> also it is possible to define a data-source in tomcat admin page.
> no my question is :
> what is differences between them , are they the same ?
> Which requirement each of this data-source has ?


>From the simplest possible perspective, one could say that the two data
sources are pretty much equivalent ... they both provide you with a
connection pool for sharing a small number of JDBC connections (to the same
underlying database) across all the incoming requests of your application,
without requiring you to allocate a request per user, even when that user
does not have an active request.

In terms of recommended usage, though, you are strongly encouraged *not* to
use the Struts version ... use the connection pool provided by your servlet
container instead.  Struts 1.0 included the data source implementation
because, at the time, most servlet containers had no such support.  Now that
they all do, the Struts data source support was deprecated in 1.1, and
removed in 1.2.

Craig


Thank you
>
>