Hi All,
I am new to IBATIS. In one requirement I need to fire a join query on two different databases that are on two different machine having separate username and password. Below is the context file entry for IBATIS.
The above connection works fine if both the databases are on the same machine and can be accessed with the same username and password. But my problem is, Both the databases are on different-different machine. How can I pass the two connection datasources?Code:<bean id="dataSourceMySQL" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> <property name="driverClassName"> <value>com.mysql.jdbc.Driver</value> </property> <property name="url"> <value>jdbc:mysql://${DATABASE_HOST_ADDRESS}:${DATABASE_PORT}/</value> </property> <property name="username"><value>${DATABASE_USERNAME}</value></property> <property name="password"><value>${DATABASE_PASSWORD}</value></property> </bean> <bean id="vfrSqlMap" class="org.springframework.orm.ibatis.SqlMapClientFactoryBean"> <property name="dataSource" ref="dataSourceMySQL" /> <property name="configLocation"> <value>classpath:alfresco/extension/vfr-SqlMap-Config.xml</value> </property> </bean> <bean id="vfrSqlMapClientTemplate" class="org.springframework.orm.ibatis.SqlMapClientTemplate"> <property name="sqlMapClient" ref="vfrSqlMap"/> </bean> <bean id="vfrSupplierDao" class="com.clms.vfr.VFRSupplierDAOImpl"> <property name="clmsSqlMapClientTemplate" ref="vfrSqlMapClientTemplate"/> </bean>
Please help!
Thanking you in advance....!


Reply With Quote