ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From friendVU admin <maill...@friendvu.com>
Subject late DS selection
Date Thu, 10 Feb 2005 17:41:02 GMT
(I can create a static sqlmap factoryinstance to have it select a 
datasource before inst, but how to go the other way, have a map select a 
static data source?).

I have a bunch of maps (sql commands).
And a bunch of data source to different dbs.

I want to select late what data source to use based on a map name. Ideas?

Idealy I can add an xml element to the statements, ex
<insert    id="usrJoin"  ds="main" ....
and then in the sqlmap helper write
if (sqlmap.getDS(mapName)=="main" ) then {
// execute map with main data source staticly bound

The thing is that sometimes a table moves from one db to another for 
good resons mostly, (it just does, the 3 dba's hate me I am sure of it).

So... ideas how to hack? As I write this... I could create a xml 
properties files of map name/data source... but that is 2 files to 
maintain. I guess I will do that.... but if somone can save me, please do.
Show me some love!

.V



Mime
View raw message