Jim,
   I am sorry but I am confused now. Just correct me if I am
wrong........ I want to call my DAO from my Action class. So the snippet
that you sent me would go in my DAO class in the function
getConnection() (or something like that). 
     And if what I said is correct then does it mean that I dont need to
have a connection pool class and my webserver would handle everything
for me.

regards
saurabh

On Mon, 2004-08-16 at 16:29, Jim Barrows wrote:
> > -----Original Message-----
> > From: Saurabh Bhatla [mailto:[EMAIL PROTECTED]
> > Sent: Monday, August 16, 2004 2:24 PM
> > To: Struts Users Mailing List
> > Subject: Re: connection pooling
> > 
> > 
> > David,
> >   But i want to make a business layer and call the DAO from there.  I
> > think that the links that you have sent me couple 
> > presentation layer and
> > database tightly. I know i can use EJB for presentation layer 
> > but I dont
> > want that as it would be overkill for the small project I am 
> > working on.
> > I want to have a connection pool class initialized at the time the
> > server starts and then all my DAO  should get the connection from that
> > pool. Is it possible?
> >   I am a beginner in this field and I might not understand it
> > completely. please correct me if i am wrong.
> 
> Ah, okay.. I also posted a link to the struts way to do the JNDI data source 
> stuff.... in that case.. you follow your web app servers guide on how to setup a 
> data source, then you follow the destructions for a normal jndi data source. 
> Something like:
> 
> /**
>      * 
>      */
>     public static DataSource getDataSource() throws NamingException {
>         if (ds == null) {
>             Context ctx = (Context) new InitialContext();
>             ds =
>                 (DataSource) ctx.lookup(
>                     "jdbc/yourDataSource);
>         }
>         return ds;
>     }
> 
> > regards
> > saurabh
> > 
> > 
> > ---------------------------------------------------------------------
> > 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]
> 
> 


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

Reply via email to