Add the attribute 'key=abc' to your <data-source> configuration.
In your action class, use

DataSource ds = servlet.findDataSource("abc");

Mark

-----Original Message-----
From: Zeltser, Mark [mailto:[EMAIL PROTECTED]]
Sent: 09 April 2001 15:52
To: '[EMAIL PROTECTED]'
Subject: RE: How to use multiple datasources ?


I am interested in this one too...

Mark.

> -----Original Message-----
> From: Szlapa, Michael [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, April 06, 2001 2:05 PM
> To:   '[EMAIL PROTECTED]'
> Subject:      How to use multiple datasources ?
> 
> Does anyone know how to configure and use multiple datasources ?
> 
> Thanks in advance
> Michael
> 
> 
> 
>               -----Original Message-----
>               From:   Szlapa, Michael
> [mailto:[EMAIL PROTECTED]]
>               Sent:   Wednesday, April 04, 2001 11:11 AM
>               To:     '[EMAIL PROTECTED]'
>               Subject:        How to use multiple datasources ?
> 
>               Hi
> 
>               I have problems understanding how I should configure
> multiple datasources to
>               be used in single application, possibly even in single
> Action or JSP page.
> 
>               I've read in API description of ActionServlet.dataSources
>                       The JDBC data sources that has been configured for
> this application,
>               if any, keyed by the servlet context attribute under which
> they are stored.
> 
>               I guess I don't understand what "servlet context attribute"
> means here,  I
>               have only one application with one servlet (ActionServlet),
> how I should
>               configure name of the context attribute ? 
> 
>               I think it would be nice if I could specify datasource name
> in the
>               struts-config like:
> 
>               <data-sources> 
>                 <data-source autoCommit="false" 
>                       name="My name"
>                       description="Trial access to database" 
>               driverClass="oracle.jdbc.driver.OracleDriver" 
>               maxCount="4"     minCount="2" 
>               password="123" 
>               url="jdbc:oracle:thin:@ado:1521:123" > > user="123" /> 
>               </data-sources> 
> 
>               and then do  findDataSource("My name");
> 
>               I have looked also at the Struts guide to find more about
> <data-source>
>               section, but it only talks about default connection. 
> 
>               TIA
>               Michael 
>               


----------------------------------------------------------------------------
--
This message is intended only for the personal and confidential use of the
designated recipient(s) named above.  If you are not the intended recipient
of this message you are hereby notified that any review, dissemination,
distribution or copying of this message is strictly prohibited.  This
communication is for information purposes only and should not be regarded as
an offer to sell or as a solicitation of an offer to buy any financial
product, an official confirmation of any transaction, or as an official
statement of Lehman Brothers Inc.  Email transmission cannot be guaranteed
to be secure or error-free.  Therefore, we do not represent that this
information is complete or accurate and it should not be relied upon as
such.  All information is subject to change without notice.




***************************************************************************
This email message contains confidential information for the above addressee only.  If 
you are not the intended addressee you must not disclose or use the information in any 
manner whatsoever.

Any opinion or views contained in this email message are those of the sender, do not 
represent those of the Company in any way and reliance should not be placed upon its 
contents.

Unless otherwise stated this email message is not intended to be contractually 
binding.  Where an Agreement exists between our respective companies and there is 
conflict between the contents of this email message and the Agreement then the terms 
of that Agreement shall prevail.

Abbey National Treasury Services plc. Registered in England. Registered Office:  Abbey 
House, Baker Street, London NW1 6XL.  Company Registration No: 2338548.  Regulated by 
the SFA
***************************************************************************

Reply via email to