struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Max Kremer" <mkre...@datastay.com>
Subject Re: getting a datasource in a bean
Date Sun, 05 Jan 2003 22:46:04 GMT
You can just look up the JNDI datasource in your bean.
----- Original Message -----
From: "Nick Torenvliet" <nick@fieldstonesolutions.com>
To: <struts-user@jakarta.apache.org>
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:struts-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
<mailto:struts-user-help@jakarta.apache.org>
>
> -
>
>


--
To unsubscribe, e-mail:   <mailto:struts-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:struts-user-help@jakarta.apache.org>


Mime
View raw message