It sounds like it can't be done in an application that has a base data access 
class that all other data access implementations inherit from.

It would be really nice if the datasource could be set on a map file by map 
file basis.

Vince
  ----- Original Message ----- 
  From: smartkid 
  To: [email protected] 
  Sent: Saturday, January 26, 2008 2:19 AM
  Subject: 答复: Multiple Datasources?


  Hi, 

   

  1.       Creates a SqlMap.xml and data maps for each database.

  2.       Creates a DomSqlMapBuilder instance for each database.

  3.       Call DomSqlMapBuilder.Configure(…) with the corresponding SqlMap.xml 
for each instance.

  4.       Use the ISqlMapper instances returned from the previous step for 
accessing a certain database.

   

   

  Pseudo code:

   

  DomSqlMapBuilder builderA = new DomSqlMapBuilder();

  ISqlMapper mapperA = builderA.Configure(“sqlMap_A.xml”);

   

  DomSqlMapBuilder builderB = new DomSqlMapBuilder();

  ISqlMapper mapperB = builder.Configure(“sqlMap_B.xml”);

   

   

  Smartkid

   

  发件人: Nathan O. Miller [mailto:[EMAIL PROTECTED] 
  发送时间: 2008年1月26日 2:38
  收件人: [email protected]
  主题: Multiple Datasources?

   

  Hello everyone,

   

  I have a web application that contains individual tools that each use their 
own database.  Is there some way for IBatis to support the use of multiple 
datasources for something like this?  

   

  Thanks,

  Nathan Miller

Reply via email to