if your servlet is extending ActionServlet, you can retreive the DataSource
from
ServletContext.getAttribute(Globals.DATA_SOURCE_KEY). You may have to append
"module key" to DATA_SOURCE_KE if you are using  modules.

If your servlet is NOT extending ActionServlet, better move( or copy?) your
Data Source from struts-config.xml to web.xml

hth
navjot singh

|-----Original Message-----
|From: Ashish Kulkarni [mailto:[EMAIL PROTECTED]
|Sent: Monday, August 18, 2003 8:38 PM
|To: [EMAIL PROTECTED]
|Subject: get data source in servlet
|
|
|Hi,
|I have defined a data source in my struts-config file,
|which is working fine as i get the connection in my
|Action class, but i need to get the data source in a
|Servlet, can any one provide with the code to get the
|data source in servlet
|
|Ashish
|
|__________________________________
|Do you Yahoo!?
|Yahoo! SiteBuilder - Free, easy-to-use web site design software
|http://sitebuilder.yahoo.com
|
|---------------------------------------------------------------------
|To unsubscribe, e-mail: [EMAIL PROTECTED]
|For additional commands, e-mail: [EMAIL PROTECTED]
|
|


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

Reply via email to