Stop! Java time! Get it? The reference to Java and U can’t touch this by MC Hammer? No? Schnitzel. Let’s get on with challenge #08 and fix a Java connection problem!
Java and Db2 API, Application Program Interface
Copy Java source coded to your Unix directory
Like most of the challenges we need to acquire some data first! Let’s get started by entering the primary command =6 from the ISPF Primary Option Menu, this boots us to the command shell. In that command shell we enter oput ‘zos.mtm2019.public.p3.source(db2java)’ ‘db2java.java’ to get the data. Don’t leave this screen yet!
Submit JCL to compile and execute the Java program
The next command we need to run is sub ‘zos.public.jcl(db2java)’ ; =sd ; st and then we need to investigate an issue. I’ll do that by using the ? line command in the NP column.
Specifically we need to view STDERR. I’ll use the v line command in the NP column.
Let me investigate…
I’ll use the primary command right 40 to shift the display up 40 characters to the right. There seems to be a problem with the authorization, as Java throws a SqlInvalidAuthorizationSpecException. I can’t say more.
Modify, compile, and execute the DB2JAVA program
Let’s enter TSO OEDIT as primary command, it can be executed directly from this screen. Then we need to select the db2java.java to edit it.
Ok, we now need to go through the code and see where it establishes a connection to DB2 server. When we find it, we need to fix it.
I have found the issue, I’m not saying it on this screenshot though (smiley with a holy halo thingy). After fixing, enter the primary command save and then tso sub ‘zos.public.jcl(db2java)’ ; =sd ; st to run the script. You may view the output and compilation stuff, but I’m going directly to P3.OUTPUT. Is this where we part ways, reader?
View member #08 in P3.OUTPUT for valid SQL result set
Voila! Done! Yes, yes, I have censored it. I need to put some effort in censoring the solutions to part 3. I’m doing my part.
How’s it going?
How are you guys/girls doing? Do you like master the mainframe? Are you doing it because of school/work/own interest? Are you blackmailed into doing it?