Java SQL
Part Three - Challenge #09

Background:

Modify previous challenge Java program

Challenge #09 assumes you successfully completed challenge #08.

The Java program from the previous challenge, db2java.java, has a SQL statement used to return a result set into p3.output(#08).

Completion of challenge 9 involves a modification to the Java program to return a different result set.


Challenge Situation

The Java program, db2java.java result set returns a phone number for a specific employee. The Java program SQL must be modified according to instructions, successfully compiled and executed.


Challenge Description

Modify, compile, and execute Java program, db2java.java to return a result set of employee number or employee numbers associated with a single phone number.

The challenge has sparse instructions. The sparse instructions is a part of the challenge demonstrating skills acquired from the previous challenges.


Challenge:

Get JCL necessary to complete challenge
  1. Copy 'zos.public.jcl(db2java)' to member db2java in your JCL data set
  2. Modify db2java in your JCL data set to write output to member #09
    in your p3.output data set
  3. Save the modified JCL member db2java
  4. Submit db2java
  5. Review JCL output for success
  6. Review p3.output(#09)
    Member #09 should be identical to member #08

Modify, compile, and execute Java program
Modify db2java.java as follows:
  1. Select only employeenumber column from table ibmuser.vphone where the phonenumber is 2167
  2. Modify Java source to read the employeenumber string from the Db2 table and output the employeenumber string preceeded by Employee Number:
  3. Submit db2java JCL from your JCL data set
    Be sure to save db2java.java changes before submitting JCL to pick up your changes
  4. Review JCL output for success
  5. Review p3.output(#09)
  6. The p3.output(#09) should now include employee number or employee numbers with phone number 2167

What did you just learn?

You just successfully modified, compiled, and executed Java source code that reads a relational database table and outputs a selected result set.


Next: Challenge #10