Topic
18 replies Latest Post - ‏2013-01-09T07:09:51Z by SystemAdmin
SystemAdmin
SystemAdmin
124 Posts
ACCEPTED ANSWER

Pinned topic CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

‏2012-11-29T09:00:58Z |
Hi

I am not able to find any IVP / Sample that can verify JDBC+JCICS together.. I have independently verified JCICS and JDBC setup/ customization.. Would appreciae If any one has samples or point me in the right direction to verify JDBC + CICS and /or JCICS + DB2.

CICS Java virtaul machine Set-Up (googled link below to a M$WORD doc) refers to JDBC IVP sample01 but can not find the source.

http://www.google.com.au/url?sa=t&rct=j&q=cics%20java%20virtual%20machine%20set-up&source=web&cd=9&ved=0CF4QFjAI&url=http%3A%2F%2Flistserv.uga.edu%2Fcgi-bin%2Fwa%3FA3%3Dind0403%26L%3Dcics-l%26P%3D299286%26E%3D2%26B%3D------_%3D_NextPart_001_01C401DB.E9972578%26N%3DCICS%2BJava%2Bsetup%2Bdetails.doc%26T%3Dapplication%2Fmsword&ei=OiS3UOGRBaiRigfk-YCIBA&usg=AFQjCNHyR1pX7LePrJXBdpGD_f5hz67tvA
regards
Updated on 2013-01-09T07:09:51Z at 2013-01-09T07:09:51Z by SystemAdmin
  • SystemAdmin
    SystemAdmin
    124 Posts
    ACCEPTED ANSWER

    Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

    ‏2012-11-29T11:41:19Z  in response to SystemAdmin
    The CICS supplied CICSjdbcDataSource sample will do what you are looking for however there is a huge GOTCHA. As shipped it requires a NameServer to which the dataSource must be published using java class CICSDataSourcePublish. Java class CICSDataSourceRetract retracts the dataSource from the name server.

    I recommend that any user replaces method lookupDataSource in class CICSjdbcDataSource with the following code

    "
    public static DataSource lookupDataSource(Context ctx, String dataSourceName) throws Exception {
    /*
    * If you don't need to look up a DataSource then don't! This is a large overhead.
    * DataSource ds = (DataSource)ctx.lookup(dataSourceName);
    */
    if (ds == null)
    {
    ds = new DB2SimpleDataSource();
    }

    return ds;
    }
    "
    as this removes any dependency on having a name server.

    The CICS transaction definitions DSDB,DSRE and DSPU can be found in CEDA group DFH£DB2 along with program definitions DFJ$DSDB DFJ$DSRE and DFJ$DSPU.

    Regards
    George Burgess
    IBM Hursley
    • SystemAdmin
      SystemAdmin
      124 Posts
      ACCEPTED ANSWER

      Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

      ‏2012-11-30T08:29:46Z  in response to SystemAdmin
      Thanks a lot Mr Burgess..

      Now I am following CICS TS for z/OS 4.1: DB2 Guide SC34-7011-02.. in Chapter 8 Page112, I can not find my DB2 V9.1 directory containing profile DSNJDBC_JDBCProfile.ser - created by the command db2genjdbc.. I can not find any reference to db2genjdbc in my install or DB2 9.1 Library..is it for DB2 V8 and I can skip this setup.

      Thanks once again for the pointer and i can see the light now..
      regards Prabhat
      • SystemAdmin
        SystemAdmin
        124 Posts
        ACCEPTED ANSWER

        Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

        ‏2012-11-30T08:49:35Z  in response to SystemAdmin
        Hello Prabhat

        db2genjdbc was dropped in DB2 V9. You need to read the chapter " Preparing and running JDBC and SQLJ programs" in the DB2 provided book "Application Programming Guide and Reference for Java™" that applies to the release of DB2 you are using.

        I will contact the CICS publications team and ask about getting an update to the CICS DB2 Guide

        Regards

        George Burgess
        IBM Hursley
        • SystemAdmin
          SystemAdmin
          124 Posts
          ACCEPTED ANSWER

          Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

          ‏2012-12-04T07:25:07Z  in response to SystemAdmin
          Thanks George.

          I have changed CICSjdbcDataSource.java as you have advised, and thanks for the APG and Reference for Java - Db2 9.1 link, I understood why this change is required.. Now running DSDB is failing with
          DFHII1013 E 2012/12/04 14:56:30 TESTCICS Failure establishing connection to host x.x.x.x. Port 2809. Reason is: Class: Dfhrzsoj,
          function: CREATE, response: EXCEPTION, reason: SERVICE_NOT_AVAILABLE.

          Our JDBC type 4 connectivity for TESTDB2 is available at PORT 447 and not default 2809. Trying to find property file where I can change this port but so far with out Luck.

          Best Regards Prabhat
          • SystemAdmin
            SystemAdmin
            124 Posts
            ACCEPTED ANSWER

            Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

            ‏2012-12-04T08:28:47Z  in response to SystemAdmin
            I am having more fun..i think still miles to go ..
            $ ls $CICS_HOME/lib/*.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/CTKInstalledR1_2.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjadjr.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcci.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcdmn.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcics.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcicsras.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcont.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjcsi.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjejbdd.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjjts.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjname.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjorb.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjoutput.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/dfjwrap.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/nssrcm.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/omgcos.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/ras.jar
            /software/CICSTS41/TGTB/usr/lpp/cicsts/cicsts41/lib/websphere.jar
            and then
            $ javac CICSjdbcDataSource.java
            CICSjdbcDataSource.java:44: package com.ibm.cics.server does not exist
            import com.ibm.cics.server.*;
            ¬
            CICSjdbcDataSource.java:58: cannot find symbol
            symbol : class Task
            location: class CICSjdbcDataSource
            Task t = Task.getTask();
            ¬
            CICSjdbcDataSource.java:58: cannot find symbol
            symbol : variable Task
            location: class CICSjdbcDataSource
            Task t = Task.getTask();
            etc.etc
            CICSjdbcDataSource.java:159: cannot find symbol
            symbol : variable ds
            location: class CICSjdbcDataSource
            return ds;
            ¬
            10 errors
            $
            May be time to open an IBM SR..

            regards Prabhat
          • JohnTilling
            JohnTilling
            7 Posts
            ACCEPTED ANSWER

            Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

            ‏2012-12-04T09:00:45Z  in response to SystemAdmin
            Hi Prabhat,

            I see you mention type 4 connectivity. Please note that JDBC type 4 connectivity is not supported under CICS. Type 2 connectivity must be used.The JDBC requests are converted to EXEC SQL statements and control flows through the CICS-DB2 Attach, in the same way as for other languages using DB2 in CICS.

            Regards,
            John Tilling
            • SystemAdmin
              SystemAdmin
              124 Posts
              ACCEPTED ANSWER

              Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

              ‏2012-12-04T13:06:50Z  in response to JohnTilling
              Hi Prabhat

              the reason your $javac CICSjdbcDataSource.java is failing is because dfjcics.jar is not in your build path, you could have similar problems with DB2SimpleDataSource and db2jcc.jar as well.

              I have found that it is far easier to use an IDE like Rational or Eclipse to create / build java objects than using command line processing.

              Use the code as shipped for type 2 connectivity. Some folks have managed to get type 4 connectivity working because they really want to use that but then you must be aware that it's use is not supported by CICS, there is no support for two phase commit, recovery etc and it is also a performance overhead that you do not want in a high volume oltp

              Regards

              George
              • SystemAdmin
                SystemAdmin
                124 Posts
                ACCEPTED ANSWER

                Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                ‏2012-12-06T07:41:41Z  in response to SystemAdmin
                Hi George / John,

                Thanks a lot for your reply and is much appreciated here.. It seems CICS 4.1 is a bottleneck and also very soon - in a month time we will be DB2 V 10 (migrating from V 9.1) . I do not think I can make my POC or Sample IVP (jdbc + jcics) work in this time.. Now I need your expertise in deciding (seeing so many problems where CICS 4.1 manual does not refer to DB2 9.1, DB2 9.1 does not refer to JCICS, Type 4 vs Type2 JDBC connectivity, JAVAC does not work despite following manuals etc )

                A) use OSGi as Java Applications deployment manager (i think it is not available in our CICS TS 4.1)..
                B) to use 64 bit Java SDK (not supported in CICS TS 4.1 but must for CICS TS 4.2)
                C) use JVM server (recommended)
                D) CICS Explorer version 1.1.1.3, CICS Explorer SDK installed in Eclipse Integrated Development Environment (IDE) IDE for Java Developers 32 bits (or 64 bits)

                So if we have CICS TS 4.2 / DB2 10.1 on z/OS 1.13 (although Java SDK 32 bit is active but 64 bit is also available) can we have a stable JAVA mainframe environment good for next couple of years. Is there and technote / publications that can combine all these components and give a single view from JAVA point of view and how to choose each of these components' version / release that will work coherently...

                thanks once again for you help and helping a newbie in Java world.

                best regards Prabhat
                • William_Yates
                  William_Yates
                  2 Posts
                  ACCEPTED ANSWER

                  Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                  ‏2012-12-06T11:23:05Z  in response to SystemAdmin
                  Prabhat

                  You might be interested to note that there is a free Java in CICS redbook that is about to be published. It is currently in draft status awaiting editing. However the draft is available on the IBM redbooks site now:
                  http://www.redbooks.ibm.com/Redbooks.nsf/RedpieceAbstracts/sg248038.html?Open

                  It covers the changes in 4.2 with regard to OSGi, JVMServers and JDBC. I think that it would be beneficial to you.

                  Regards
                  William Yates
                • SystemAdmin
                  SystemAdmin
                  124 Posts
                  ACCEPTED ANSWER

                  Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                  ‏2012-12-07T13:58:41Z  in response to SystemAdmin
                  Hi Prabhat

                  If I were you I would use Eclipse 3.7.2 and the latest CICS Explorer SDK to develop your PoC or sample program

                  In CICS TS 5.1, Generally Available next week, the JVMPool option has been removed meaning that you will save yourself a lot of migration work in the future if you start your java journey by using the OSGI model in CICS TS 4.2.

                  Should you continue with CICS TS 4.1 and the JVMPool model the CICS Explorer SDK gives you the ability to convert JVMPool java applications to OSGI plug-ins when you are ready to make the move.

                  Regarding level of java being used provided you do not use higher level java in a lower level of CICS you will be fine. That is use the level supported by the release of CICS you will be using.

                  The redbook that Will mentions is an excellent starting point and covers what you are looking for. I would have mentioned this earlier however it has only just been made available.

                  Regards

                  George
                  • SystemAdmin
                    SystemAdmin
                    124 Posts
                    ACCEPTED ANSWER

                    Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                    ‏2012-12-10T07:23:57Z  in response to SystemAdmin
                    Thanks George / William

                    First and foremost thanks a lot for answering my stupid questions.

                    I must admit I got little disappointed when new "Java Application Development for CICS" draft redbook - SG24-5275-03 did not provide additional download /samples.. Earlier CICS java books did. May be its proven technology now and customers do not need help with "Getting started".

                    I am about to download CICS TS 5.1 Developer code , while management verifies licensing (and $$$$) involved in upgrading from CICS TS4.1 to 5.1.

                    In the meanwhile I am not able to get my OMVS/USS profiles right. For CLASSPATH in my .profile I have coded
                    export CLASSPATH=/db2/db2910_jdbc/classes/db2jcc.jar:\
                    /db2/db2910_jdbc/classes/db2jcc_license_cisuz.jar:\
                    /db2/db2910_jdbc/classes/db2jcc_javax.jar:\
                    /db2/db2910_jdbc/classes/sqlj.zip:$CLASSPATH
                    and i am getting
                    export: /u/CICS/T5CICST1/.profile 13: FSUM7354 "/db2/db2910_jdbc/classes/db2jcc_license_cisuz.jar:" is not an identifier

                    db2jcc_license_cisuz.jar is a license file and I do not remember if we ever bought any DB2 JDBC license. Is this error due to license file or is it my shell script knowledge.

                    best regards PRABHAT
                    • SystemAdmin
                      SystemAdmin
                      124 Posts
                      ACCEPTED ANSWER

                      Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                      ‏2012-12-10T08:22:52Z  in response to SystemAdmin
                      DUH .. being Monday did not have enough caffeine / nicotine in the blood.. instead of
                      "I must admit I got little disappointed when new "Java Application Development for CICS" draft redbook - SG24-5275-03 did not provide additional download /samples."

                      I meant to say
                      I must admit I got little disappointed when new "CICS and JVM Server - Developing and Deploying Java Applications " draft redbook - SG24--8038-00 did not provide additional download /samples.
                      thanks Prabhat
                      • SystemAdmin
                        SystemAdmin
                        124 Posts
                        ACCEPTED ANSWER

                        Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                        ‏2012-12-11T11:13:55Z  in response to SystemAdmin
                        Hi Prabhat

                        Redbook "CICS and JVM Server - Developing and Deploying Java Application" is intended to document the upgrade process from JVMPool to JVM Server making the assumption that the reader has already installed the original sample application discussed in redbook "Java Application Development for CICS" .

                        Regards

                        George Burgess
                    • SystemAdmin
                      SystemAdmin
                      124 Posts
                      ACCEPTED ANSWER

                      Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                      ‏2012-12-10T11:20:14Z  in response to SystemAdmin
                      Hi Prabhat,

                      It's a problem with your script as export CLASSPATH does not validate the values of the paths added. Make sure that you don't have any leading or trailing spaces. I would recommend not using ISPF to edit scripts. Either use an FTP client to edit on your workstation, or use an editor from a USS telnet or SSH session such as vi.

                      However, you will need the DB2 license jar to access DB2 from Java, so you should check that the file exists.

                      Regards,
                      Dave
                      • SystemAdmin
                        SystemAdmin
                        124 Posts
                        ACCEPTED ANSWER

                        Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

                        ‏2012-12-11T11:29:51Z  in response to SystemAdmin
                        Thanks Dave

                        much appreciated.. using vi did fix the problem.. I have tested CICS explorer with zosmf extension and that workes too..
                        Regards Prabhat
  • SystemAdmin
    SystemAdmin
    124 Posts
    ACCEPTED ANSWER

    Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

    ‏2012-12-24T03:54:26Z  in response to SystemAdmin
    Thanks Russel /Dave

    Finally things are falling in place..type 2 (with and without SSL) and type 4 JDBC db2 drivers, all JCICS samples (including web services) are working. Now we have a business requirement to trigger a CICS transaction based on some CICS event to run JAVA CODE - JDBC driver to read db2 table and push data to extrenal web server..

    As far as I know CICS /TS 4.1 does not have any OSGI support..Can you please advise how shpuild i go about it..and will this code (pr what components) will be eligible for ziip / zaap processing work.
    regards Prabhat..
    • SystemAdmin
      SystemAdmin
      124 Posts
      ACCEPTED ANSWER

      Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

      ‏2012-12-24T08:49:16Z  in response to SystemAdmin
      Hi Prabhat

      Good to hear that you are making progress.

      Unfortunately OSGI support is only available from CICS TS 4.2 and later. DB2 and XML parsing work is offloaded to zIIP while Java code uses zAAP. You need to ensure that your z/OS is correctly configured for this to work.

      This redbook should help you with the Event Processing requirement
      http://www.redbooks.ibm.com/abstracts/sg247792.html

      Please remember that launching a JVM, not a JVM Server, is much more expensive than a normal assembler / cobol program and therefore has performance implications in a high volume environment - this is much improved when using a JVMServer in CICS TS 4.2 and later

      Regards

      George Burgess
  • SystemAdmin
    SystemAdmin
    124 Posts
    ACCEPTED ANSWER

    Re: CICS 4.1 DB2 9.1 and JCICS + JDBC IVP

    ‏2013-01-09T07:09:51Z  in response to SystemAdmin
    Thanks George..

    I have got my POC TYPE 2 DB2 connector to read DB2 table and push results on Web sever working.

    Although may open another thread to test CICS EVENT to trigger JDBC and push results to Web server, in case of problems.

    best regards
    Prabhat