On 15/08/2003 15:59 Ashish Kulkarni wrote:
Hi,

I am using struts 1.1 and have defined a data source
for connection pooling, in my Action class i get the
data source by using simple
 DataSource dataSourceA = getDataSource(request, "A");
 Connection myConnection =
dataSourceA.getConnection();

But now i need to get the data source in a servlet
which does not extend Action class, but HttpServlet
can any one provide code for it

One way would be to put the datasource in the session - the servlet could get it from there. Alternately you could use JNDI to access the datasource instead of having it configured in your Struts config file.


HTH

--
Paul Thomas
+------------------------------+---------------------------------------------+
| Thomas Micro Systems Limited | Software Solutions for the Smaller Business |
| Computer Consultants | http://www.thomas-micro-systems-ltd.co.uk |
+------------------------------+---------------------------------------------+


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



Reply via email to