ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From oleksa borodie <oleksa.boro...@gmail.com>
Subject Re: How to configure Ibatis to use two different IBatis mappers(not nHibernate) for two databases and using IBatis DAO?
Date Wed, 20 Jul 2005 15:44:05 GMT

> 1º - I have to persist objets in TWO different databases (Informix and SQL
> Server)
> 2º - I have to use TWO IBatis Mappers (Informix and SqlServer)
> 3º - I have to use DaoManager to manage my DAO objects.
>         ex: DaoManager.GetInstance("InformixMapDAO") and
> DaoManager.GetInstance("SqlServerMapDAO")

 May be such my code will help you:

private static SqlMapper GetMapper(string sqlmapname)
XmlDocument document = new XmlDocument();
return SqlMapper.Configure(document);

This is body of the function that returns SqlMapper configured by file
that name is passed as parameter. Configuration file looks like:

<?xml version="1.0" encoding="UTF-8" ?>

<context name="Scrooge"/>
 <database >
 <provider name="sqlServer1.1"/>
  <dataSource name="ScroogeDB" connectionString="will be set in the run-time"/>

  <sqlMap resource="/Maps/Scrooge.xml"/>

View raw message