This sample application, distributed as /neon/sql illustrates how to use Shadow REXXTOOLs to directly access DB2 databases from a REXX-Language Web Transaction event procedure.
The Shadow/Rexxtools feature of Shadow OS/390 Web Server allows you to send SQL statements directly to the ADDRESS SQL host command environment. There, the SQL statement is executed and Rexx variables return the results to this procedure where they can be operated upon further to create the desired web browser output.
Should this sample program fail to operate correctly, the most likely cause is that the Servers parameters are not configured correctly. This sample relies upon the start-up parameters, DEFAULTDB2SUBSYS and DEFAULTDB2PLAN being set to the correct values.
This sample program contains the following two lines of Rexx coding which performs the actual DB2 query:
ADDRESS SQL
"Select * From Q.STAFF Order by Name"
DB2 Results Returned for the Query
Name Job Description Department ABRAHAMS CLERK 38 BURKE CLERK 66 DANIELS MGR 10 DAVIS SALES 84 EDWARDS SALES 84 FRAYE MGR 51 GAFNEY CLERK 84 GONZALES SALES 66 GRAHAM SALES 66 HANES MGR 15 JAMES CLERK 20 JONES MGR 10 KERMISCH CLERK 15 KOONITZ SALES 42 LEA MGR 66 LU MGR 10 LUNDQUIST CLERK 51 MARENGHI MGR 38 MOLINARE MGR 10 NAUGHTON CLERK 38 NGAN CLERK 15 O'BRIEN SALES 38 PERNAL SALES 20 PLOTZ MGR 42 QUIGLEY SALES 38 QUILL MGR 84 ROTHMAN SALES 15 SANDERS MGR 20 SCOUTTEN CLERK 42 SMITH SALES 51 SNEIDER CLERK 20 WHEELER CLERK 51 WILLIAMS SALES 51 WILSON SALES 66 YAMAGUCHI CLERK 42