struts-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "julio" <ju...@softsite.com.br>
Subject RES: Datasource Retrieval in 1.1 (Help needed)
Date Fri, 06 Sep 2002 15:07:52 GMT
Hi Craig,

This question was already answered, look for the subject "Connection
Pool Question"(15/08/2002). Anyway, the code... 

"
Then, in your action, you can access your datasource via:
execute(......)
{
DataSource ds = this.getDataSource(request);
}
...
...
"

________________________________
Julio Cesar
Softsite Tecnologia Ltda
http://www.softsite.com.br
Fortaleza, CE, Brasil

-----Mensagem original-----
De: Craig Tataryn [mailto:craiger316@hotmail.com] 
Enviada em: sexta-feira, 6 de setembro de 2002 11:47
Para: struts-user@jakarta.apache.org
Assunto: Re: Datasource Retrieval in 1.1 (Help needed)

>From ActionServlet.findDatasource() API docs:
Deprecated. Look up data sources directly in servlet context attributes

So I replaced my call to :
dataSource = getServlet().findDatasource(null);

with:
dataSource = 
(DataSource)getServlet().getServletContext().getAttribute(this.DATA_SOUR
CE_KEY);

And my datasource is retuned as null.

Anyone know what's going on?

Craig.

>From: "Craig Tataryn" <craiger316@hotmail.com>
>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>To: struts-user@jakarta.apache.org
>Subject: Re: Datasource Retrieval in 1.1
>Date: Thu, 05 Sep 2002 14:09:35 -0500
>
>Ok, read the DTD for struts-config.xml and figured out that I would use
the 
>"key" attribute if I were to add another datasource.  I would still
like to 
>know how to retrieve the datasource without using the deprecated 
>findDatasource() method.
>
>Thanks,
>
>Craig.
>
>
>>From: "Craig Tataryn" <craiger316@hotmail.com>
>>Reply-To: "Struts Users Mailing List" <struts-user@jakarta.apache.org>
>>To: struts-user@jakarta.apache.org
>>Subject: Datasource Retrieval in 1.1
>>Date: Thu, 05 Sep 2002 11:30:39 -0500
>>
>>The documentation still lists the old way of how to retrieve a
datasource 
>>which has been setup in struts-config.xml using findDatasource();
>>
>>The API says to "use datasource stored in attributes".  Can someone
give 
>>an example of how I might do this from within my execute method?  I
want 
>>to get rid of my deprecation warnings for findDatasource()
>>
>>As well, I believe you can have multiple datasources setup in 
>>struts-config.xml.  The default datasource being keyed by 
>>org.apache.struts.action.Action.DATA_SOURCE_KEY.  Could someone point
me 
>>to an example of multiple datasources and how to setup keys for each?
>>
>>Thanks,
>>
>>Craig.
>>
>>Craig W. Tataryn
>>Programmer/Analyst
>>Compuware
>>
>>_________________________________________________________________
>>Join the world's largest e-mail service with MSN Hotmail. 
>>http://www.hotmail.com
>>
>>
>>--
>>To unsubscribe, e-mail:   
>><mailto:struts-user-unsubscribe@jakarta.apache.org>
>>For additional commands, e-mail: 
>><mailto:struts-user-help@jakarta.apache.org>
>
>
>Craig W. Tataryn
>Programmer/Analyst
>Compuware
>
>_________________________________________________________________
>MSN Photos is the easiest way to share and print your photos: 
>http://photos.msn.com/support/worldwide.aspx
>
>
>--
>To unsubscribe, e-mail:   
><mailto:struts-user-unsubscribe@jakarta.apache.org>
>For additional commands, e-mail: 
><mailto:struts-user-help@jakarta.apache.org>


Craig W. Tataryn
Programmer/Analyst
Compuware

_________________________________________________________________
Send and receive Hotmail on your mobile device: http://mobile.msn.com


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