Shyamsunder Reddy ha scritto:
What is the best place to call Websphere DataSource in Struts application.

Eheh, it's not so simple :-)

Instantiate it when ActionServlet is loaded and then pass onto Model classes as 
reference

ABSOLUTELY NOT!

 OR create a static class that instantiates the DataSource and getConnections 
from this class which should be Singleton

Do not use singleton in web application, because it raises several problem during reloading the webapp.

Instead, you could use a container-managed datasource to call through JNDI:
http://tomcat.apache.org/tomcat-5.5-doc/jndi-datasource-examples-howto.html

Or use Spring or a similar IoC container to configure your Model (this is what I prefer to do):
http://static.springframework.org/spring/docs/2.0.x/reference/beans.html#beans-value-element

HTH
Antonio

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

Reply via email to