ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sundar Sankaranarayanan" <Sundar.Sankaranaraya...@phoenix.edu>
Subject RE: How to configure Multiple datasource in SqlMapConfig.xml
Date Thu, 17 Jan 2008 20:55:12 GMT
Hi Jasmin,
                 You might wanna have 2 different sql map files and
handle transactions through XA. 
 
Regards
-S

________________________________

From: Jasmin_Mehta@nexweb.org [mailto:Jasmin_Mehta@nexweb.org] 
Sent: Thursday, January 17, 2008 1:49 PM
To: user-java@ibatis.apache.org
Subject: How to configure Multiple datasource in SqlMapConfig.xml



Hi, 

In my project, I have to connect to 2 totally different databases and
run separate queries. How can I define that in SqlMapConfig.xml. The
iBATIS config file does not allow multiple <transactionManager> or
<dataSource> element according to
http://ibatis.apache.org/dtd/sql-map-config-2.dtd. 

Also what and how would be property name known to iBATIS in that case. 

I have my one of the datasource setup like : 

 <properties resource="ResourceParams.properties"/>   
  
  <transactionManager type="JDBC" commitRequired="false"> 
    <dataSource type="SIMPLE"> 
      <property name="JDBC.Driver" value="${driverName}"/> 
      <property name="JDBC.ConnectionURL" value="${rmsJdbcUrl}"/> 
      <property name="JDBC.Username" value="${rmsUserName}"/> 
      <property name="JDBC.Password" value="${rmsPassword}"/>       
      <property name="JDBC.Class"
value="oracle.jdbc.pool.OracleDataSource"/> 
      <property name="JDBC.Location" value="jdbc/pool/OracleDS"/> 
      <property name="JDBC.DefaultAutoCommit" value="true" /> 
      <property name="Pool.MaximumActiveConnections" value="10"/> 
      <property name="Pool.MaximumIdleConnections" value="5"/> 
      <property name="Pool.MaximumCheckoutTime" value="120000"/> 
      <property name="Pool.TimeToWait" value="500"/> 
    </dataSource> 
  </transactionManager> 


Where ResourceParams.properties has 

driverName=oracle.jdbc.driver.OracleDriver 

rmsJdbcUrl=jdbc:oracle:thin:@dbHost_1:dbPort_1:dbSid_1 
rmsUserName=username_1 
rmsPassword=pwd_1 


otmJdbcUrl=jdbc:oracle:thin:@dbHost_2:dbPort_2:dbSid_2 
otmdbUserName=username_1 
otmdbPassword=pwd_1 


How can I configure otmJdbcUrl,  otmdbUserName and otmdbPassword. 

And there after how to I map <sqlMap> to each of them with separate
resources. 

Thanks 
Jasmin 

************************************************************************
******
ATTENTION ATTENTION ATTENTION ATTENTION ATTENTION 
Our domain name is changing.  Please take note of the sender's
e-Mail address and make changes to your personal address list,
if needed.  Both domains will continue to work, only for a limited
time.
************************************************************************
******
This email and any files transmitted with it are intended solely for 
the use of the individual or agency to whom they are addressed. 
If you have received this email in error please notify the Navy 
Exchange Service Command e-mail administrator. This footnote 
also confirms that this email message has been scanned for the
presence of computer viruses.

Thank You!            
************************************************************************
******


Mime
View raw message