You can just look up the JNDI datasource in your bean. ----- Original Message ----- From: "Nick Torenvliet" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Sunday, January 05, 2003 4:51 PM Subject: getting a datasource in a bean
> Hi, Just as in the examples on the struts site I've succesfully > configured a mysql datasource and had it print the results of queries > from out of an action class. I am using struts 1.1-b2. > > I want to replace my current dbpooling(I wrote last year)with the struts > datasource and dbcp, I am having one problem though. I can't get a > connection in my beans to the database because I have no access to the > getDataSource(request,key) method. Since my pooling methods were hard > wired I just went in to the database by passing a database name to the > methods. > > The stock answer is to pass a connection to the bean, but that means > I'll be rewriting a lot of code. > > How can I access the datasource from a bean? > > ~/nick > > > -- > To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> > For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> > > - > > -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

