ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Giorgio Vespucci <giorgio.vespu...@gmail.com>
Subject Dynamic DataSource
Date Fri, 21 May 2010 10:43:23 GMT
Hi everybody
We have the need to decide the referring datasource for some iBatis
DAO at login.
We are using Spring 3.0.2 with iBatis 2.x

We have some properties for the pool _luckily_ fixed, but the DBNAME.
Now the situation is as follow:
<from applicationContext.xml>

<bean id="dao" class="....SqlMapFlussoNauiDao"
        <property name="sqlMapClient" ref="sqlMap" />
        <property name="dataSource" ref="NOW_FIXED-datasource" />

<bean id="NOW_FIXED-datasource"
        <property name="driverClassName"
        <property name="url" value="jdbc:jtds:sqlserver://HOST:PORT/DBNAME"/>
        <property name="username" value="USERNAME"/>
        <property name="password" value="PASSWORD"/>
        <property name="maxActive" value="30"/>
        <property name="maxIdle" value="10"/>
        <property name="maxWait" value="1000"/>
        <property name="defaultAutoCommit" value="true"/>

The varying part is the DBNAME, because each user of the webapp
belongs to a group that see the same database

Each logged user must use the DAO pointing to its particular DBNAME on
the same SQLServer HOST:PORT

I googled the Spring UserCredentialsDataSourceAdapter.

Someone faced with same problem and fixed it?
Thanks to all

P.S. Maybe is a question for Spring user list, but I started from here
because we're using iBatis ;)
Giorgio Vespucci
giorgio [dot] vespucci [at] gmail [dot] com
Skype, Twitter, Slideshare: gvespucci
Linux User #471792

To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org

View raw message