I'm really sorry to post this mail again,, but is there something i'm not understanding ? Or does everyone do all their queries in action servlets?
I can see how what i'm trying could be wrong in that, if i want to reuse my non servlet classes using the datasource in config.xml might render this webappliction-specific. But then again it is also true that using the settings in the config file has a certain appeal especially if one is looking at supporting more than one db vendor. I understand that perhaps i need to have a pool of connections, but i want to leave this stuff as an optimisation rather than a means of getting to the settings in config.xml. -- here's my original message-- hello you'll all have to forgive my stupidity but i've been having real problems trying to reference the datasource specified in config.xml in my business logic classes. I've been very good and seperated everything as one should. but i really need a straight answer to this (i.e. an example that works). "For maximum code re-use, business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment" now i've only seen examples referencing the datasource inside an action servlet, this appears to go against the design pattern. So how do i do this? have i neglected to find the correct example? why are all the examples of how to reference the datasource breaking the aforementioned priciple? please i'm very confused .. -- many thanks in advance mark Many thanks in advance mark ------ Forwarded Message From: Mark <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Date: Tue, 17 Dec 2002 11:18:25 +0100 To: Struts Users Mailing List <[EMAIL PROTECTED]> Subject: FW: dataSources outside of actionservlet Sorry to repost this question, but the more i think about it the more i think it a reasonable one (please tell me if i'm wrong). ------ Forwarded Message From: "Mark Lowe" <[EMAIL PROTECTED]> Reply-To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Date: Tue, 17 Dec 2002 09:03:33 +0100 To: "Struts Users Mailing List" <[EMAIL PROTECTED]> Subject: dataSources outside of actionservlet hello you'll all have to forgive my stupidity but i've been having real problems trying to reference the datasource specified in config.xml in my business logic classes. I've been very good and seperated everything as one should. but i really need a straight answer to this (i.e. an example that works). "For maximum code re-use, business logic beans should be designed and implemented so that they do not know they are being executed in a web application environment" now i've only seen examples referencing the datasource inside an action servlet, this appears to go against the design pattern. So how do i do this? have i neglected to find the correct example? why are all the examples of how to reference the datasource breaking the aforementioned priciple? please i'm very confused .. many thanks in advance mark -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ------ End of Forwarded Message -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> ------ End of Forwarded Message -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

