358 IBM Express Runtime V2.1
set appArg [lindex $argv 0]
set result APP_DOES_NOT_EXIST
foreach appName $appList {
puts $appName
if {$appName == $appArg} {
set result APP_EXISTS
break
}
}
puts $result
The WebsphereConfigProcs.jacl script file
Example B-7 is a sample WebSphereConfigProcs.jacl file which was used for deploying the
Trade6 application.
Example: B-7 WebSphereConfigProcs.jacl file
# %I% %W% %G% %U%
# Licensed Materials - Property of IBM
#
# 5724-F71 5724-J10
#
# (C) Copyright IBM Corporation 2004, 2005 All Rights Reserved
#
# US Government Users Restricted Rights- Use, duplication or
# disclosure restricted by GSA ADP Schedule Contract with IBM
# Corp.
#
# This is sample code made available for use in accordance with
# terms set forth in the license agreement document for the IBM
# Express Runtime.
#---------------------------------------------------
# Config procs
#---------------------------------------------------
# JACL NOTES
# Braces inside comments are still matched.
# What that means is that you must provide a matching end brace if you want to
# comment out a line e.g.
# if { condition } { ;# you must provide the ending brace even tho this line is commented
# }
#---------------------------------------------------
#
# createDB2JDBCProvider - this takes base node, the server name,
# the JDBCProvider name, the classpath to the
# JDBCProvider code, the name of the implementation
# class, the xa setting, and a description
# Parameters:
# bn - baseNode - typically DefaultNode
# serv - server name - typically server1
# provName - name of the JDBC provider - can be any string
Appendix B. Source code for Trade6 user programs and script files for Linux on POWER 359
# classpath - path to and including the db2java.zip file e.g. C:/sqllib/java/db2java.zip
# implClass - implementation class name of the JDBC driver - typically
COM.ibm.db2.jdbc.DB2ConnectionPoolDataSource
# xa - whether this datasource is single or 2 phase - true/false
# desc - free form description string
#
# NOTES:
# - nativepath - not used in this proc
# - propertySet - not used in this proc
#
#---------------------------------------------------
proc createDB2JDBCProvider {bn serv provName classPath implClass xa desc} {
puts "\nConfigProcs: createDB2JDBCProvider $bn $serv provName classPath implClass xa
desc"
global AdminConfig ;# Access the AdminConfig command
if {[file exists $classPath]} {
# get the path name upto the driver to use for DB2_JDBC_DRIVER_PATH
set db2jdbcdriverpath [file dirname $classPath]
# set the WebSphere environment variable DB2_JDBC_DRIVER_PATH at node scope
updateVariableMap DB2_JDBC_DRIVER_PATH $db2jdbcdriverpath
# use the WebSphere environment variable DB2_JDBC_DRIVER_PATH in the JDBC provider
set jdbcProvClasspath [file join \$\{DB2_JDBC_DRIVER_PATH\} [file tail
$classPath]]
} else {
return -code error "Could not find the JDBC driver at the location provided
$classPath"
}
#---------------------------------------------------------
# Get the config id of the server
#---------------------------------------------------------
set parent [$AdminConfig getid /Node:$bn/]
#--------------------------------------------------------------
# Set the variables for the JDBCProvider, use path and name provided
# in the arguments
#--------------------------------------------------------------
set pname_attr [list name $provName]
set path_attr [list classpath $jdbcProvClasspath]
set impl_attr [list implementationClassName $implClass]
set desc_attr [list description $desc]
set xa_attr [list xa $xa]
set jdbcAttrs [list $pname_attr $path_attr $impl_attr $xa_attr $desc_attr]
puts "\nConfigProcs: create JDBCProvider $parent $jdbcAttrs"
$AdminConfig create JDBCProvider $parent $jdbcAttrs
}
# createJDBCProviderUsingTemplate - creates a new DB2 type 2 legacy provider at the server
scope
#
# This method has the advantage of delegating most of the responsibility for
# knowing the right implementation class name and other driver details to
# WebSphere itself.
#
# Parameters
# provName - name of the provider - any text string
# classpath - path to and including the db2java.zip file e.g.
C:/sqllib/java/db2java.zip

Get IBM Express Runtime V2.1 now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.