Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2014
    Posts
    294

    Unanswered: Job creation in db2

    Hi,

    I have a procedure as P1 & this procedure is calling some internal procedures. We have a java application to call this P1 on db2 server. My requirement is java application is calling P1 as a procedure till now. Is there any way to create a JOB in db2 server , so that I can place that procedure call in a JOB & that java application can directly call that JOB alone.

    I want to create a JOB in db2 without using the Wizard or scheduler. some what like a CREATE JOB ,if exists in db2.

  2. #2
    Join Date
    Jul 2013
    Location
    Moscow, Russia
    Posts
    666
    Provided Answers: 55
    Hi,

    Why don't you like schedulers?
    Do you need to run your JOB once? Use 'nohup myscript.sh &' in this case...
    Regards,
    Mark.

  3. #3
    Join Date
    Jul 2014
    Posts
    294
    Thanks Mark.
    I am totally new to these db2. I am learning now. I can't use schedulers as the procedure calls will be depend upon Java application. Hence I am looking for a job(command level) creation in db2. If there is no such functionality in db2 then I look for some alternative, just want to know whether this is possible or not without wizards & schedulers.

  4. #4
    Join Date
    Sep 2013
    Location
    India
    Posts
    246
    Hello,

    If for some you only want to use java for calling the procedures and also you want to create a job at DB level that the only way you can do it is as follows:

    1. CALL "SQLJ"."DB2_INSTALL_JAR"("file://datahome/db2inst1/procedures/your_java_file.jar", "any_name_mapping",0)

    2. Check corresponding jar, its appearing in sysibm.sysjarobjects

    select * from sysibm.sysjarobjects

    3. create a db level external procedure

    CREATE PROCEDURE MYPROC.TEST_PROC(INOUT V varchar(2))
    SPECIFIC TEST_PROC
    DYNAMIC RESULT SETS 0
    DETERMINISTIC
    LANGUAGE JAVA
    PARAMETER STYLE JAVA
    NO DBINFO
    THREADSAFE
    MODIFIES SQL DATA
    PROGRAM TYPE SUB
    EXTERNAL NAME 'your_java_file!your_java_method'

    You may need help of java developer for the above configuration.

    4. at end schedule the procedure in db scheduler.
    ssumit

  5. #5
    Join Date
    Jul 2014
    Posts
    294
    Thanks Sumit,

    I got what u r saying. I will try this with my java team.out of curiosity, Is there any other way which can be done only using db2 server.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •