The following examples demonstrate how to define a Java TM 2 Enterprise Edition (J2EE) resource in the WebSphere Application Server V4 and V5:
call syscalls 'ON' signal on error name. = 0 name.1 = "conversationname" name.2 = "j2eeresourcename" name.3 = "j2eeresourcedescription" name.4 = "j2eeresourcetype" val. = 0 val.1 = "API Functiontest" val.2 = "db2resA" val.3 = "my DB2 resource" val.4 = "DB2datasource" rc = 4 i = 1 do while (name.i <> '0') rc = XMLGEN("tempin" name.i val.i) if (rc == 4) then do say "create J2EE resource failed during XMLGEN" exit end i = i+1 end; rc = CB390CFG("-action 'createj2eeresource' -xmlinput 'inputcreatej2eeresource.xml' -input 'tempin' -output 'test.create.resource'") if (rc == 4) then do say "create J2EE resource failed" exit end exit error: say "script error at line" sigl say sourceline(sigl) exit
The command sequence given below accomplishes approximately the same thing as the V4 SMAPI commands.
wsadmin> set node [$AdminConfig getid /Node:SY1/]When the wsadmin scripting tool sets the node, you see output similar to the following:
SY1(cells/SY1/nodes/SY1:node.xml#Node_1)
wsadmin> set provider [$AdminConfig create JDBCProvider $node {{classpath /db2beta/db2710/class es/db2j2classes.zip} {implementationClassName com.ibm.db2.jcc.DB2ConnectionPoolDataSource} {name myDB2driver}}]When the application successfully sets the provider, you see a message similar to the following:
myDB2driver(cells/SY1/nodes/SY1:resources.xml#JDBCProvider_3)
wsadmin> $AdminConfig create DataSource $provider {{name db2resA} {description My DB2 resource}}When the wsadmin scripting tool creates the J2EE resource, you see output similar to the following:
db2resA(cells/SY1/nodes/SY1:resources.xml#DataSource_2)
wsadmin> $AdminConfig save