| <?xml version="1.0" encoding="ISO-8859-1"?> |
| <!-- |
| |
| Copyright (c) 2017, 2018 Oracle and/or its affiliates. All rights reserved. |
| |
| This program and the accompanying materials are made available under the |
| terms of the Eclipse Public License v. 2.0, which is available at |
| http://www.eclipse.org/legal/epl-2.0. |
| |
| This Source Code may also be made available under the following Secondary |
| Licenses when the conditions for such availability set forth in the |
| Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
| version 2 with the GNU Classpath Exception, which is available at |
| https://www.gnu.org/software/classpath/license.html. |
| |
| SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| |
| --> |
| |
| <!-- |
| |
| Note: The targets here use properties that need to be modified |
| to suit your local settings in the JdbcCommon.properties |
| --> |
| |
| <target name="deploy-jdbc-oracle-common" depends="init-common"> |
| <antcall target="create-jdbc-connpool-oracle-common"/> |
| <antcall target="create-jdbc-resource-oracle-common"/> |
| </target> |
| |
| <target name="undeploy-jdbc-oracle-common" depends="init-common"> |
| <antcall target="delete-jdbc-resource-oracle-common"/> |
| <antcall target="delete-jdbc-connpool-oracle-common"/> |
| </target> |
| |
| <target name="deploy-jdbc-driver-oracle-common" depends="init-common"> |
| <antcall target="create-jdbc-driver-connpool-oracle-common"/> |
| <antcall target="create-jdbc-resource-oracle-common"/> |
| </target> |
| |
| <!-- Create oracle datasource based connection pool --> |
| <target name="create-jdbc-connpool-oracle-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-connection-pool |
| --datasourceclassname=${oracle.datasource.class} |
| --restype=${oracle.resource.type}"/> |
| <param name="operand.props" value="${oracle.pool.name}"/> |
| </antcall> |
| |
| <antcall target="set-oracle-props-common"/> |
| </target> |
| |
| <!-- Create oracle driver based connection pool --> |
| <target name="create-jdbc-driver-connpool-oracle-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-connection-pool |
| --driverclassname=${oracle.driver.class} |
| --restype=${oracle.resource.type}"/> |
| <param name="operand.props" value="${oracle.pool.name}"/> |
| </antcall> |
| |
| <antcall target="set-oracle-props-common"/> |
| </target> |
| |
| <!-- Set common properties for a oracle datasource/driver pool --> |
| <target name="set-oracle-props-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.pool.name}.property.User=${oracle.user}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.pool.name}.property.Password=${oracle.password}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.pool.name}.property.URL=${oracle.url}"/> |
| </antcall> |
| </target> |
| |
| <!-- Create an oracle jdbc resource --> |
| <target name="create-jdbc-resource-oracle-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-resource |
| --connectionpoolid ${oracle.pool.name}"/> |
| <param name="operand.props" value="${oracle.resource.name}"/> |
| </antcall> |
| </target> |
| |
| <!-- Delete an oracle connection pool --> |
| <target name="delete-jdbc-connpool-oracle-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-connection-pool"/> |
| <param name="operand.props" value="${oracle.pool.name}"/> |
| </antcall> |
| </target> |
| |
| <!-- Delete an oracle jdbc resource --> |
| <target name="delete-jdbc-resource-oracle-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-resource"/> |
| <param name="operand.props" value="${oracle.resource.name}"/> |
| </antcall> |
| </target> |
| |
| <!-- Set up an Oracle XA datasource --> |
| <target name="deploy-jdbc-oracle-xa-common" depends="init-common"> |
| <antcall target="create-jdbc-connpool-oracle-xa-common"/> |
| <antcall target="create-jdbc-resource-oracle-xa-common"/> |
| </target> |
| |
| <target name="undeploy-jdbc-oracle-xa-common" depends="init-common"> |
| <antcall target="delete-jdbc-resource-oracle-xa-common"/> |
| <antcall target="delete-jdbc-connpool-oracle-xa-common"/> |
| </target> |
| |
| <target name="create-jdbc-connpool-oracle-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-connection-pool |
| --datasourceclassname=${oracle.xadatasource.class} |
| --restype=javax.sql.XADataSource"/> |
| <param name="operand.props" value="${oracle.xapool.name}"/> |
| </antcall> |
| |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.xapool.name}.property.User=${oracle.user}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.xapool.name}.property.Password=${oracle.password}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${oracle.xapool.name}.property.URL=${oracle.url}"/> |
| </antcall> |
| </target> |
| |
| <target name="create-jdbc-resource-oracle-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-resource |
| --connectionpoolid ${oracle.xapool.name}"/> |
| <param name="operand.props" value="${oracle.xaresource.name}"/> |
| </antcall> |
| </target> |
| |
| <target name="delete-jdbc-connpool-oracle-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-connection-pool"/> |
| <param name="operand.props" value="${oracle.xapool.name}"/> |
| </antcall> |
| </target> |
| <target name="delete-jdbc-resource-oracle-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-resource"/> |
| <param name="operand.props" value="${oracle.xaresource.name}"/> |
| </antcall> |
| </target> |
| |
| <target name="execute-sql-oracle-common" depends="init-common"> |
| <sql |
| driver="${oracle.driver.name}" |
| url="${oracle.url}" |
| userid="${oracle.user}" |
| password="${oracle.password}" |
| src="${sql.file}" |
| onerror="continue" |
| print="yes" |
| output="${build.classes.dir}/setupDBTables.out" |
| classpath="${env.APS_HOME}/devtests/jdbc/classes12.zip" |
| /> |
| |
| </target> |
| |
| |
| |
| <!-- |
| MySQL related resource creation/deletion |
| --> |
| <target name="deploy-jdbc-mysql-common" depends="init-common"> |
| <antcall target="create-jdbc-connpool-mysql-common"/> |
| <antcall target="create-jdbc-resource-mysql-common"/> |
| </target> |
| |
| <target name="undeploy-jdbc-mysql-common" depends="init-common"> |
| <antcall target="delete-jdbc-resource-mysql-common"/> |
| <antcall target="delete-jdbc-connpool-mysql-common"/> |
| </target> |
| |
| <target name="delete-jdbc-resource-mysql-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="delete-jdbc-resource"/> |
| <param name="operand.props" value="${mysql.xa.resource.name}"/> |
| </antcall> |
| </target> |
| <target name="delete-jdbc-connpool-mysql-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-connection-pool"/> |
| <param name="operand.props" value="${mysql.xa.pool.name}"/> |
| </antcall> |
| </target> |
| |
| |
| <target name="create-jdbc-connpool-mysql-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-connection-pool |
| --datasourceclassname=${mysql.datasource.class} |
| --restype=javax.sql.DataSource"/> |
| <param name="operand.props" value="${mysql.pool.name}"/> |
| </antcall> |
| |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.pool.name}.property.User=${mysql.user}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.pool.name}.property.Password=${mysql.password}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.pool.name}.property.serverName=${mysql.serverName}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.pool.name}.property.databaseName=${mysql.databaseName}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.pool.name}.property.port=${mysql.port}"/> |
| </antcall> |
| </target> |
| |
| <target name="create-jdbc-resource-mysql-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-resource |
| --connectionpoolid ${mysql.pool.name}"/> |
| <param name="operand.props" value="${mysql.resource.name}"/> |
| </antcall> |
| </target> |
| |
| <target name="delete-jdbc-connpool-mysql-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-connection-pool"/> |
| <param name="operand.props" value="${mysql.pool.name}"/> |
| </antcall> |
| </target> |
| <target name="delete-jdbc-resource-mysql-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="delete-jdbc-resource"/> |
| <param name="operand.props" value="${mysql.resource.name}"/> |
| </antcall> |
| </target> |
| |
| <target name="deploy-jdbc-mysql-xa-common" depends="init-common"> |
| <antcall target="create-jdbc-connpool-mysql-xa-common"/> |
| <antcall target="create-jdbc-resource-mysql-xa-common"/> |
| </target> |
| |
| <target name="undeploy-jdbc-mysql-xa-common" depends="init-common"> |
| <antcall target="delete-jdbc-resource-mysql-xa-common"/> |
| <antcall target="delete-jdbc-connpool-mysql-xa-common"/> |
| </target> |
| |
| <target name="create-jdbc-connpool-mysql-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-connection-pool |
| --datasourceclassname=${mysql.xa.datasource.class} |
| --restype=javax.sql.XADataSource"/> |
| <param name="operand.props" value="${mysql.xa.pool.name}"/> |
| </antcall> |
| |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.xa.pool.name}.property.User=${mysql.user}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.xa.pool.name}.property.Password=${mysql.password}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.xa.pool.name}.property.serverName=${mysql.serverName}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.xa.pool.name}.property.databaseName=${mysql.databaseName}"/> |
| </antcall> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" value="set"/> |
| <param name="operand.props" |
| value="${resources.dottedname.prefix}.jdbc-connection-pool.${mysql.xa.pool.name}.property.port=${mysql.port}"/> |
| </antcall> |
| </target> |
| |
| <target name="create-jdbc-resource-mysql-xa-common" depends="init-common"> |
| <antcall target="asadmin-common-ignore-fail"> |
| <param name="admin.command" |
| value="create-jdbc-resource |
| --connectionpoolid ${mysql.xa.pool.name}"/> |
| <param name="operand.props" value="${mysql.xa.resource.name}"/> |
| </antcall> |
| </target> |
| |
| <target name="execute-sql-mysql-common" depends="init-common"> |
| <sql |
| driver="${mysql.driver.name}" |
| url="${mysql.url}" |
| userid="${mysql.user}" |
| password="${mysql.password}" |
| src="${sql.file}" |
| onerror="continue" |
| print="yes" |
| output="${build.classes.dir}/setupDBTables.out" |
| classpath="${env.S1AS_HOME}/lib/mysql-connector-java-5.1.7-bin.jar" |
| /> |
| </target> |
| |
| <target name="setup-derby-for-authentication"> |
| <antcall target="stop-derby"/> |
| |
| <copy file="${env.S1AS_HOME}/databases/derby.properties" tofile="${env.S1AS_HOME}/databases/derby.properties.bkp" overwrite="true" |
| failonerror="false"/> |
| <copy file="${env.APS_HOME}/devtests/jdbc/derby.auth.properties" tofile="${env.S1AS_HOME}/databases/derby.properties" overwrite="true"/> |
| <antcall target="start-derby"/> |
| </target> |
| |
| <condition property="aix"> |
| <os name="AIX"/> |
| </condition> |
| |
| <target name="start-derby" depends="init-common"> |
| <antcall target="start-derby-aix"/> |
| <antcall target="start-derby-nonaix"/> |
| </target> |
| |
| <target name="start-derby-aix" if="aix"> |
| <echo message="Starting Derby DB Server ..."/> |
| <parallel> |
| <java classname="org.apache.derby.drda.NetworkServerControl" |
| classpath="${db.classpath}" fork="true" spawn="true"> |
| <arg line="-h localhost -p 1527 -noSecurityManager start"/> |
| <jvmarg value="-Dderby.system.home=${env.S1AS_HOME}/databases"/> |
| </java> |
| </parallel> |
| <antcall target="execute-sleep"/> |
| </target> |
| |
| <target name="start-derby-nonaix" unless="aix"> |
| <echo message="Starting Derby DB Server ..."/> |
| <parallel> |
| <java classname="org.apache.derby.drda.NetworkServerControl" |
| classpath="${db.classpath}" fork="true" spawn="true"> |
| <arg line="-h 0.0.0.0 -p 1527 -noSecurityManager start"/> |
| <jvmarg value="-Dderby.system.home=${env.S1AS_HOME}/databases"/> |
| </java> |
| </parallel> |
| <sleep seconds="15"/> |
| </target> |
| |
| <target name="stop-derby" depends="init-common"> |
| <antcall target="stop-derby-aix"/> |
| <antcall target="stop-derby-nonaix"/> |
| </target> |
| |
| <target name="stop-derby-aix" if="aix"> |
| <echo message="Stopping Derby DB Server ..."/> |
| <parallel> |
| <java classname="org.apache.derby.drda.NetworkServerControl" |
| classpath="${db.classpath}" failonerror="true" fork="true"> |
| <arg line="-h localhost -p 1527 -user ${derby.user} -password ${derby.password} shutdown"/> |
| </java> |
| </parallel> |
| </target> |
| |
| <target name="stop-derby-nonaix" unless="aix"> |
| <echo message="Stopping Derby DB Server ..."/> |
| <parallel> |
| <java classname="org.apache.derby.drda.NetworkServerControl" |
| classpath="${db.classpath}" failonerror="true" fork="true"> |
| <arg line="-h 0.0.0.0 -p 1527 -user ${derby.user} -password ${derby.password} shutdown"/> |
| </java> |
| </parallel> |
| </target> |
| |
| <target name="reset-derby-for-no-authentication"> |
| <antcall target="stop-derby"/> |
| <delete file="${env.S1AS_HOME}/databases/derby.properties" failonerror="false"/> |
| <copy file="${env.S1AS_HOME}/databases/derby.properties.bkp" tofile="${env.S1AS_HOME}/databases/derby.properties" overwrite="true" |
| failonerror="false"/> |
| <delete file="${env.S1AS_HOME}/databases/derby.properties.bkp" failonerror="false"/> |
| <antcall target="start-derby"/> |
| </target> |