You can grab the datasource out of the ServletContext. Use JNDI or pass the DataSource to some ServiceFactory that your business layer can use.

David



From: Guido <[EMAIL PROTECTED]>
Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: DataSource references in Business Layer
Date: Sat, 15 Mar 2003 17:22:20 +0100 (MET)

Two simple questions.

1. I usally define all the datasources i need in struts-config.xml file.
It is very easy, but how can I obtain a datasource reference in my
business logic classes?

I hate the idea of passing the reference to the business methods and I
don't want to include all my business logic in the Action classes (that is
what i am actually doing)... Maybe it is not possible and I should use
JNDI or something like that instead.

2. What method should I use if ActionServlet.findDataSource(String) is now
deprecated?

Thank you very much,
Guido.

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


_________________________________________________________________
Tired of spam? Get advanced junk mail protection with MSN 8. http://join.msn.com/?page=features/junkmail



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



Reply via email to