| <!-- | |
| 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 | |
| --> | |
| <!-- | |
| <!DOCTYPE project [ | |
| <!ENTITY common SYSTEM "file:../../../config/common.xml"> | |
| <!ENTITY testcommon SYSTEM "file:../../../config/properties.xml"> | |
| ]> | |
| --> | |
| <!-- ============================ --> | |
| <!-- ORACLE SETUP FOR CONPOOL --> | |
| <!-- ============================ --> | |
| <!-- | |
| <project name="oracle-db-settings" default="create-jdbc-conpool-connector" basedir="."> | |
| &common; | |
| &testcommon; | |
| --> | |
| <target name="create-jdbc-conpool-connector" depends="default-jdbc-conpool, oracle-jdbc-conpool"/> | |
| <target name="default-jdbc-conpool" depends="init-common" unless="oracle"> | |
| <antcall target="create-jdbc-connpool-common"/> | |
| </target> | |
| <target name="oracle-jdbc-conpool" depends="init-common" if="oracle"> | |
| <echo message="creating jdbc connection pool ${jdbc.conpool.name}" | |
| level="verbose"/> | |
| <exec executable="${ASADMIN}" failonerror="false"> | |
| <arg line="create-jdbc-connection-pool"/> | |
| <arg line="--datasourceclassname ${db.class}"/> | |
| <arg line="--restype ${jdbc.resource.type}"/> | |
| <arg line="--target ${appserver.instance.name}"/> | |
| <arg line="${as.props}"/> | |
| <arg line="${jdbc.conpool.name}"/> | |
| </exec> | |
| <antcall target="set-oracle-props"> | |
| <param name="pool.type" value="jdbc"/> | |
| <param name="conpool.name" value="${jdbc.conpool.name}"/> | |
| </antcall> | |
| </target> | |
| <target name="set-oracle-props" depends="init-common" if="oracle"> | |
| <property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.ServerName=${oracleForConnector.host}"/> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.PortNumber=${oracleForConnector.port}" /> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.DatabaseName='jdbc:sun:oracle://${oracleForConnector.host}:${oracleForConnector.port};SID=${oracleForConnector.sid}' " /> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.ClassName=${oracleForConnector.dbclass}" /> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.SID=${oracleForConnector.sid}" /> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.User=${oracleForConnector.user}" /> | |
| </antcall> | |
| <antcall target="asadmin-common-ignore-fail"> | |
| <param name="admin.command" value="set" /> | |
| <param name="operand.props" | |
| value="${resources.dottedname.prefix}.${pool.type}-connection-pool.${conpool.name}.property.Password=${oracleForConnector.pwd}" /> | |
| </antcall> | |
| </target> | |
| <target name="execute-sql-connector" depends="init-common, default-sql, sql-oracle"/> | |
| <target name="default-sql" depends="init-common" unless="oracle" > | |
| <antcall target="execute-sql-common"/> | |
| </target> | |
| <target name="sql-oracle" depends="init-common" if="oracle"> | |
| <property file="${env.APS_HOME}/devtests/connector/config/oracle.properties"/> | |
| <property name="domain.lib.ext" value="${env.S1AS_HOME}/domains/domain1/lib/ext"/> | |
| <property name="oracle.driver.path" value="${domain.lib.ext}/smoracle.jar:${domain.lib.ext}/smbase.jar:${domain.lib.ext}/smresource.jar:${domain.lib.ext}/smutil.jar:${domain.lib.ext}/smspy.jar:${domain.lib.ext}/Oranxo.jar"/> | |
| <echo message="${oracleForConnector.driver}"/> | |
| <echo message="Executing sql statement at ${basedir} from ${sql.file}" | |
| level="verbose"/> | |
| <sql | |
| driver="${oracleForConnector.driver}" | |
| url="${oracleForConnector.url}" | |
| userid="${oracleForConnector.user}" | |
| password="${oracleForConnector.pwd}" | |
| src="${sql.file}" | |
| onerror="continue" | |
| print="yes" | |
| classpath="${oracle.driver.path}"/> | |
| </target> | |
| <!-- | |
| </project> | |
| --> |