> -----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]