Hi:

I think this is the sort of thing you may be looking for:

Context ctx = new InitialContext();
org.apache.commons.dbcp.BasicDataSource ds =
                
(org.apache.commons.dbcp.BasicDataSource)ctx.lookup("java:comp/env/jdbc/yourDB"));

Regards,
Geeta
        

> -----Original Message-----
> From: Koon Yue Lam [mailto:[EMAIL PROTECTED]
> Sent: Friday, July 16, 2004 5:18 AM
> To: Struts Users Mailing List
> Subject: Re: About datasource
> 
> 
> Hi, after some thinking, I have another problem, ^^
> If I am using an Action (which extent the Struts' Action class), I can
> get the Datasource by calling getDataSource()
> But now I want to write my own data assess object which shouldn't
> extent Action, I don't know what way I can get the datasource from the
> pool.....
> 
> any help??
> 
> Regards
> 
> ---------------------------------------------------------------------
> 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