Struts stores the datasources as servlet context attributes.

You can access the default datasource in your servlet using -

        (DataSource) getServletContext().getAttribute(Globals.DATA_SOURCE_KEY);

Take a look at the struts-config dtd for more info (particularly if you use
modules)
http://jakarta.apache.org/struts/dtds/struts-config_1_1.dtd

Steve

> -----Original Message-----
> From: Richard Raquepo [mailto:[EMAIL PROTECTED]
> Sent: June 29, 2003 11:22 PM
> To: Struts Users Mailing List
> Subject: using struts datasource from a servlet
>
>
> can i call/use the a struts datasource in my servlet.
>
> the thing is, i have a struts app. then i created a servlet to do
> some specific thing. now my question is,
> can i use the datasource defined in my struts config file in my
> servlet. if so, how? example code will
> be very much appreciated.
>
> thanks.
>
> -richard



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

Reply via email to