The following Ant commands would create one TimesTen DataSource and one Oracle DataSource.

To use this configuration, the resource adaptor entity would be created with the configuration properties ConfigProfile=dbquery-config/TT-Ora-Config,ConfigProfileAddNodeSuffix=false.

oracle-timesten.build.xml
<?xml version="1.0"?>

<project name="dbquery-ra-oracle-timesten-examples" default="deploy-oracle-timesten-example" basedir="./..">

    <import file="${basedir}/examples/common.build.xml"/>
    <import file="${basedir}/examples/oracle.build.xml"/>
    <import file="${basedir}/examples/timesten.build.xml"/>

    <target name="deploy-oracle-timesten" depends="oracle, deploy-oracle-library, timesten, deploy-timesten-library, deploy-dbquery-ra,
                                                   create-oracle-timesten-dbquery-profiles, create-dbquery-ra-entity"
            description="Deploy Oracle+TimesTen RA"/>

    <target name="create-oracle-timesten-dbquery-profiles" depends="init, login" description="Create profiles for Oracle/TimesTen configuration">
        <slee-management>
            <createprofile tablename="dbquery-ds" profilename="TTDataSource">
                <profilevalue name="Description" value="mappings (TT Direct)"/>
                <profilevalue name="DataSourceClass" value="com.timesten.jdbc.ObservableConnectionDS"/>
                <profilevalue name="Url" value="jdbc:timesten:direct:dsn=mappings"/>
                <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-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&#xa;"/>
                <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="TT-Ora-Config">
                <profilevalue name="DataSourceProfileIDs" value="[dbquery-ds/TTDataSource,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-timesten" depends="undeploy-dbquery-ra, undeploy-oracle-library, undeploy-timesten-library"
            description="Undeploy Oracle+TimesTen RA"/>

    <target name="deploy-oracle-timesten-example" depends="deploy-oracle-timesten, deploy-example-service"
            description="Deploy Oracle+TimesTen RA with example"/>

    <target name="undeploy-oracle-timesten-example" depends="undeploy-example-service, undeploy-oracle-timesten"
            description="Undeploy Oracle+TimesTen RA with example"/>

</project>
Previous page Next page