ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Calling procedures from 2 different databases
Date Wed, 24 Oct 2007 19:51:04 GMT
One database per SqlmapConfig - that's the rule.

If you have two databases, then you need two instances of the SqlMapConfig.
IIRC you are using Spring, so...

1. Declare two datasources
2. Declare two SqlMapConfigs - inject a datasource accordingly
3. Inject the appropriate SqlMapConfig into the appropriate DAO.  So, a
particular instance of a DAO is tied to one and only one database.

In general, you should keep the SQL for the different databases in different
XML files - although this is not strictly required.

Jeff Butler


On 10/24/07, Vinaya Tirikkovalluru <vinaya.tirikkovalluru@converge.com>
wrote:
>
>   Hi,
>
>
>
> I am connected to 2 different databases from the application.
>
>
>
> How would ibatis know which database to go when I try to access a
> procedure?
>
> Can I access procedures from 2 databases within the same xml?
>
>
>
> Thanks in advance
>
> Vinaya
>
> ------------------------------
> This electronic message is intended only for the use of the individual(s)
> or entity(ies) named above and may contain information which is privileged
> and/or confidential. If you are not the intended recipient, be aware that
> any disclosure, copying, distribution, dissemination or use of the contents
> of this message is prohibited. If you received this message in error, please
> notify the sender immediately.
>
>

Mime
View raw message