ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mkhitaryan, Aram" <Aram.Mkhitar...@lycos-europe.com>
Subject RE: connections to different databases
Date Mon, 31 Jul 2006 12:06:50 GMT
Oh, I have never used IBATIS with Spring.

I was talking about custom implementation/handling sqlmap client or daomanager.

But I think there should be another configuration for this case.

If I find useful documentation I will send the link.


-----Original Message-----
From: Gwyn Evans [mailto:gwyn.evans@gmail.com] 
Sent: Monday, July 31, 2006 4:59 PM
To: user-java@ibatis.apache.org
Subject: Re: connections to different databases

It certainly looks so - I've only got a Spring setup, though...
    <bean id="dataSource"
        <property name="jndiName"><value>${jndi.name}</value></property>

    <bean id="sqlMapClient"
        <property name="configLocation" value="classpath:sqlMapConfig.xml"/>
        <property name="dataSource" ref="dataSource"/>

    <!-- setup dao implemations -->
    <bean id="adminDaoImpl" class="package.dao.impl.AdminDaoImpl">
        <property name="sqlMapClient" ref="sqlMapClient"/>
    <bean id="configDaoImpl" class="package.dao.impl.ConfigDaoImpl">
        <property name="sqlMapClient" ref="sqlMapClient"/>

In the above, I'm using a shared dataSource, but the DaoImpls extend
Spring's SqlMapClientDaoSupport, which also supports a "dataSource"
property, so I'd expect to be able to remove it from the
"sqlMapClient" bean and add Dao-specific ones to the DaoImpl beans.


On 31/07/06, Eugeny N Dzhurinsky <bofh@redwerk.com> wrote:
> Hello!
> Is it possible somehow to use several databases for single SqlMapClient
> instance?
> For example, I would like to use queries in namespace "spider" to be executed
> on MySQL, and queries in the reset namepaces to be executed on PostgreSQL, w/o
> creating 2 instances of SQL map clients.
> --
> Eugene N Dzhurinsky
View raw message