Re: Data-sources using struts:Tomcat's or NOT?

2006-04-20 Thread M.Liang Liu
Thanks a lot for every one's immediate remark.I may have got it.

And I find that the  struts-doc-1.2.9 is of use for beginners as me.


Re: Data-sources using struts:Tomcat's or NOT?

2006-04-20 Thread Dave Newton
M.Liang Liu wrote:
> My question is that: Which one is better namely more effective?Which one is 
> deprecated? Or both are OK?
>   

>From http://struts.apache.org/struts-doc-1.2.9/faqs/database.html:

"NOTE: It is preferred that data connectivity be handled directly by the
business classes, usually via JNDI. The Struts DataSource manager should
only be used with legacy business classes that don't provide their own
connectivity. When possible, we strongly recommend use of the standard
DAO pattern, so that the Action classes do not need to know anything
about the persitence mechanism. The DataSource manager is being retained
in Struts 1.x for backward compatibility but may not be retained in
Struts 2.x or later.

Also, by putting datasource definitions in JNDI it makes it very simple
to change your connection parameters based on which server you're on;
nice for development/staging/production environments.

Dave



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



Re: Data-sources using struts:Tomcat's or NOT?

2006-04-20 Thread Tamas Szabo
Hi,

On 4/21/06, M.Liang Liu <[EMAIL PROTECTED]> wrote:
>
> I am a freshman to struts.
> And now I got a problem to make my decision which data-source should I
> choose.
>
> The  point is as following:
>   I created a project via myeclipse using Tomcat 5.5.X as the web
> server.Asa result,I can use the Tomcat data-source related to JNDI:
>  Step1.define the Resource in the Server.xml under the folder
> %Tomcat_Home%\conf\
>  Step2.define the Resource-ref in the web.xml of the very project I
> created .
> And I find  it works well.
>
> When I started to learn struts,I found that I can define the data-source
> in
> the struts-config.xml.What has confused me is that it is an absolutely new
> one different from Tomcat's.
>
>
> My question is that: Which one is better namely more effective?Which one
> is
> deprecated?Or both are OK?
>
>
> Any pointers would be appreciated.



As Craig pointed ou a few days or weeks? ago you should use Tomcat's.
The Struts datasource was developed just because at that time it wasn't
possible to configure a datasource in Tomcat.

Tamas


Re: Data-sources using struts:Tomcat's or NOT?

2006-04-20 Thread Dan Jas
I saw a comment earlier that the Struts data-source is deprecated and should 
not be used.



- Original Message - 
From: "M.Liang Liu " <[EMAIL PROTECTED]>

To: 
Sent: Thursday, April 20, 2006 9:45 PM
Subject: Data-sources using struts:Tomcat's or NOT?



I am a freshman to struts.
And now I got a problem to make my decision which data-source should I
choose.

The  point is as following:
 I created a project via myeclipse using Tomcat 5.5.X as the web
server.Asa result,I can use the Tomcat data-source related to JNDI:
Step1.define the Resource in the Server.xml under the folder
%Tomcat_Home%\conf\
Step2.define the Resource-ref in the web.xml of the very project I
created .
And I find  it works well.

When I started to learn struts,I found that I can define the data-source 
in

the struts-config.xml.What has confused me is that it is an absolutely new
one different from Tomcat's.


My question is that: Which one is better namely more effective?Which one 
is

deprecated?Or both are OK?


Any pointers would be appreciated.




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



Data-sources using struts:Tomcat's or NOT?

2006-04-20 Thread M.Liang Liu
I am a freshman to struts.
And now I got a problem to make my decision which data-source should I
choose.

The  point is as following:
  I created a project via myeclipse using Tomcat 5.5.X as the web
server.Asa result,I can use the Tomcat data-source related to JNDI:
 Step1.define the Resource in the Server.xml under the folder
%Tomcat_Home%\conf\
 Step2.define the Resource-ref in the web.xml of the very project I
created .
And I find  it works well.

When I started to learn struts,I found that I can define the data-source in
the struts-config.xml.What has confused me is that it is an absolutely new
one different from Tomcat's.


My question is that: Which one is better namely more effective?Which one is
deprecated?Or both are OK?


Any pointers would be appreciated.