The following Ant commands would create one MySQL DataSource and one Oracle DataSource.
To use this configuration, the resource adaptor entity would be created with the configuration properties
ConfigProfile=dbquery-config/MySQL-Ora-Config,ConfigProfileAddNodeSuffix=false
.
oracle-timesten.build.xml
<?xml version="1.0"?>
<project name="dbquery-ra-oracle-mysql-examples" default="deploy-oracle-mysql-example" basedir="./..">
<import file="${basedir}/examples/common.build.xml"/>
<import file="${basedir}/examples/oracle.build.xml"/>
<import file="${basedir}/examples/mysql.build.xml"/>
<target name="deploy-oracle-mysql" depends="oracle, deploy-oracle-library, deploy-mysql, deploy-mysql-library, deploy-dbquery-ra,
create-oracle-mysql-dbquery-profiles, create-dbquery-ra-entity"
description="Deploy Oracle+MySQL RA"/>
<target name="create-oracle-mysql-dbquery-profiles" depends="init, login" description="Create profiles for Oracle/MySQL configuration">
<slee-management>
<createprofile tablename="dbquery-ds" profilename="MysqlDataSource">
<profilevalue name="Description" value="${mysql.host} (MySQL)"/>
<profilevalue name="DataSourceClass" value="com.mysql.jdbc.jdbc2.optional.MysqlDataSource"/>
<profilevalue name="Url" value="jdbc:mysql://${mysql.host}:3306/${mysql.database}"/>
<profilevalue name="User" value="${mysql.user}"/>
<profilevalue name="Password" value="${mysql.password}"/>
<profilevalue name="AdminEnable" value="true"/>
<profilevalue name="WorkerThreads" value="5"/>
<profilevalue name="QueryTimeout" value="10000"/> <!-- milliseconds -->
</createprofile>
<createprofile tablename="dbquery-ds" profilename="OraDataSource">
<profilevalue name="Description" value="${oracle.host} (Oracle)"/>
<profilevalue name="DataSourceClass" value="oracle.jdbc.pool.OracleConnectionPoolDataSource"/>
<profilevalue name="ConnectionProperties" value="oracle.jdbc.ReadTimeout: 30000
"/>
<profilevalue name="URL" value="jdbc:oracle:thin:@//${oracle.host}:1521/${oracle.database}"/>
<profilevalue name="User" value="appuser"/>
<profilevalue name="Password" value="appuser"/>
<profilevalue name="AdminEnable" value="true"/>
<profilevalue name="WorkerThreads" value="5"/>
<profilevalue name="QueryTimeout" value="10000"/> <!-- milliseconds -->
</createprofile>
<createprofile tablename="dbquery-config" profilename="MySQL-Ora-Config">
<profilevalue name="DataSourceProfileIDs" value="[dbquery-ds/MysqlDataSource,dbquery-ds/OraDataSource]"/>
<profilevalue name="TestSql" value="SELECT short_code FROM mappings WHERE short_code IS NULL"/>
<profilevalue name="ProfilePollTime" value="5000"/> <!-- milliseconds -->
<profilevalue name="MaxSyncTransactionAge" value="120000"/> <!-- milliseconds -->
<profilevalue name="MaxLostTransactionAge" value="120000"/> <!-- milliseconds -->
</createprofile>
</slee-management>
<property name="dbqueryra.properties" value="ConfigProfile=dbquery-config/TT-Ora-Config,ConfigProfileAddNodeSuffix=false"/>
</target>
<target name="undeploy-oracle-mysql" depends="undeploy-dbquery-ra, undeploy-oracle-library, undeploy-mysql-library"
description="Undeploy Oracle+MySQL RA"/>
<target name="deploy-oracle-mysql-example" depends="deploy-oracle-mysql, deploy-example-service"
description="Deploy Oracle+MySQL RA with example"/>
<target name="undeploy-oracle-mysql-example" depends="undeploy-example-service, undeploy-oracle-mysql"
description="Undeploy Oracle+MySQL RA with example"/>
</project>