How to get job id in my java code?

I know that using showjobs command can get the list of jobs and their id.But I want give to control the users to access the reports.This means the different users can only stop the report which I give them permission.How can I solve this problem?If has any suggestion,please answer me of mail to ma.thank a lot.

What would you do with the pid? the actual pid is OS dependent in form and how to react. You could do what I've done in the past and that is to do the following.
I have a java task that spawns new instances of 'things'. As each thing is 'exec'ed, I place its Process object into a 'running queue' and then periodically check its exitValue() to determine if it is still running or not.
if you don't care about OS dependency and happen to be on a unix system, then when you exec the process, add a unique string as a command line argument that you know won't be used. something like this:
mypgm -a=blah -b=blah2 myUniqueString
Then in your code that retrieves the process id, simply do something like this:
ps -efwww | grep myUniqueString | awk ....
awk it into something usable or perhaps just grab the raw and parse it in java to extract the process id.
I think the danger would reside in the idea that if you were to grab the processid and then do a 'kill -9 xx' that java might not clean up correctly. What would happen if a db transaction was taking place right as the -9 signal was received? The results of course would be OS dependent.
Why do you need the process id? thats the real question....

Similar Messages

  • How to get af:commandbutton id in java code when it is triggered?

    Hi All
    In my application's homepage, I am using 2 af:commandbuttons and each using action attribute to call a method. Both are calling the same method, and based on its id, it should perform different operations. Could anyone please tell me how to get command buttons id in java code, when it is triggered.
    Regards
    Venkat

    Venkat,
    why not call different methods from each button?
    public String actionButton1()
    return doAction("button1");
    public String actionButton2()
    return doAction("button2");
    public String doAction(String aBuuton)
    if ("button1".equalsIgnoreCase(aButton))
    // do work for button 1
    return "abc";
    }else {
    // do work for button 2
    return "abc";
    }Now you user actionbutton1 for the first button and actionButton2 for the second.
    Or you directly implement two different methods in the bean and call each one directly from the button.
    Timo

  • How to get value in HKEY_LOCAL_MACHINE in Java code

    Our system use Apache-Tomcat. My java program needs to get the registry information (server name, port number,...) in HKEY_LOCAL_MACHINE on the same computer. Could it be done without JNI? Please forward instruction.
    Thanks.

    here is an API
    http://downloads.openchannelsoftware.com/JIFI/jifidoc/javax/jifi/service/win32registry/Registry.html
    try downloading it at http://www.openchannelsoftware.com/

  • How to get the context data using java script in interactive forms

    Hi All,
    How to get the context data using java script in interactive forms by adobe,  am using web dynpro java
    thanks.

    Hi venkat,
    Please Refer this link.
      Populating one Drop-Down list from the selection of another Drop-down list
    Thanks,
    Raju.

  • In ABAP HR how to get job using position

    In ABAP HR how to get job using position (Using Infotype 1001)

    Hi anilkumar,
    1. u have the position
       u want the Job
    2. In hrp1001 table
       OTYPE = 'S' (for position)
       OBJID  = POSITION (AS ABOVE)
       SCLAS = 'C' (for finding job)
    <b>   SOBID = XXXXXX (here u will get the JOB)</b>
    regards,
    amit m.

  • How to call a .bat file from java code?

    How to call a .bat file from java code? and how can i pass parameters to that .bat file?
    Thanks in advance

    thanks for ur reply
    but still i am getting the same error.
    I am trying to run a .bat file of together tool, my code looks like below
    import java.lang.Runtime;
    import java.lang.Process;
    import java.io.File;
    class SysCall{
         public static void main(String args[]){
              String cmd="D://Borland//Together6.2//bin//Together.bat -script:com.togethersoft.modules.qa.QA -metrics out:D://MySamples//Metrics// -fmt:html D://Borland//Together6.2//samples//java//CashSales//CashSales.tpr";
              //String path="D://Borland//Together6.2//bin//Together.bat ";
              Runtime r= Runtime.getRuntime(); //Declare the system call
              try{
                   System.out.println("Before batch is called");
                   Process p=r.exec(cmd);
                   System.out.println(" Exit value =" + p.exitValue());
                   System.out.println("After batch is called");
              /*can produce errors which must be caught*/
              catch(Exception e) {
                   e.printStackTrace();
                   System.out.println (e.toString());
    I am getting the below exception
    Before batch is called
    java.lang.IllegalThreadStateException: process has not exited
    at java.lang.Win32Process.exitValue(Native Method)
    at SysCall.main(SysCall.java:17)
    java.lang.IllegalThreadStateException: process has not exited

  • How to use .properties files in Webdynpro Java code?

    Hi all,
      I want to use a logon.properties file when I initial a JCO connection pool in my webdynpro DC (JCO.addClientPool()),but  I found when I deployed this DC to the server, it always giv e me an FileNotFoundException. So I donot know how to deploy a .properties file to the server and how to access this file in my Java code?
    Thans and Best regards
    Deyang

    Hi,
    1) put .properties file to your packege under src\packages folder (src\packages\com\sdn\properties\jco.properties)
    2) load property:
         final InputStream is = getClass().getClassLoader().getResourceAsStream("com/sdn/properties/jco.properties");
         final Properties properties = new Properties();
         try
              properties.load(is);
         catch(Exception e)
              wdComponentAPI.getMessageManager().reportException(new WDNonFatalException(e), false);
    Regatds Maxim R.

  • How to create a oracle database by java code?

    how to create a oracle database by java code?
    please give some ways then that way's code

    I'm not sure what you mean with "database". Do you mean an Oracle instance or an Oracle user/schema (probably the latter, because that's the equivalent to a MS SQL Database).
    Creating an instance is definitely not possible from within Java. To create a new user this should be possible, as this can be done with SQL:
    GRANT connect,resource TO <newuser> IDENTIFIED BY <password>;
    I'm always cautious with questions like this. In 90% of the cases there is something wrong with the initial design. Creating a database shouldn't be something the application is doing.
    Thomas

  • How to call web-service using only java code

    Hello, how to call web-service using only java code. I can call it from BPM process or Web Dynpro Java Application, but if I need to call it from ejb component?

    I'm found answer:
    Java and SAP Portal blog: How to call web service from java code example

  • How to read XI Data type in Java code and populate as array list, using UDF

    Hi,
    How to read XI Data type in Java code and populate as array list, using UDF?
    Is there any API using which  the XI data types can be read?
    Kindly reply.
    Richa

    Input Structure:
    <?xml version="1.0" encoding="UTF-8"?>
    <ns0:CustomerCreateResp xmlns:ns0="urn:bp:xi:up:re:cust_mdm:cmdm:pr5:100">
       <CUSTOMER>
          <item>
             <CUSTOMERNO/>
             <MDMCUSTOMER/>
             <CREATE_DATE/>
             <RETURN>
                <TYPE/>
                <MESSAGE/>
             </RETURN>
             <PT_CONTPART_RETURN>
                <item>
                   <MDM_CONTACT/>
                   <CONTACT/>
                </item>
             </PT_CONTPART_RETURN>
             <PARTNERS>
                <item>
                   <CUSTOMERNO/>
                   <PARTNER_FUNCTION/>
                   <PARTNER_NUMBER/>
                   <DEFAULT_PARTNER/>
                </item>
             </PARTNERS>
          </item>
       </CUSTOMER>
    </ns0:CustomerCreateResp>
    Output structure
    (Sample output structure.This actually needs to be mapped and generated using UDF)
    <?xml version="1.0" encoding="UTF-8"?>
    <ns1:updateCustomer xmlns:ns1="urn:xiSericeVi"><ns1:customer><ns2:ArrayList xmlns:ns2="java:sap/standard">[]</ns2:ArrayList></ns1:customer><ns1:name>2344566</ns1:name></ns1:updateCustomer>

  • How to find the  System Dbtype in java code

    How to find the System Dbtype in java code
    I need various Db connection my project (oracle, sq l,sybase,db2),So How to find the System Dbtype in java code

    Welcome to the Forums.
    Please go through the FAQ of the Forum.
    You has posted your query in the wrong Forum, this one is dedicated to Oracle Forms.
    Please try {forum:id=1050}.
    Regards,

  • Pleasse How To  Compute Spaces in Statement (by JAVA code)

    hi
    Please can you help me ;
    How To Compute Spaces in Statement (by JAVA code) .
    Best Regards;

    Hi,
    can you be more specific? What statement? If it is a string you can use a String buffer and add spaces to wherever you want within a string.
    Frank

  • How to get system popup menu in java?

    I want to know how to get windows xp or any operating systems default popupmenu in java.
    And i also have problem for using mnemonic for JPopupMenu, it works well when i first press right click of my mouse and use the specified mnemonic for that the action specifed for that is triggered but when is use mnemonic without the using my mouse it doesn't trigger why.

    Please how to get native(e.g windows explorer) popup menu in jfilechooser

  • How to get the value retruned by java script function into my jsp page

    Hai all,
    I had a particular java script function which returns a date.
    function getDate() {
         var sDate;
    // This code executes when the user clicks on a day in the calendar.
    if ("TD" == event.srcElement.tagName)
    // Test whether day is valid.
    if ("" != event.srcElement.innerText)
    //alert(event.srcElement.innerText);
    sDate = document.all.year.value + "-" + document.all.month.value + "-" + event.srcElement.innerText;
    document.all.ret.value = sDate;
    var mahi=window.open("configurexml.jsp?xyz=document.all.ret.value")
    return sDate;}
    Now i want to display this particular date in my jsp page. can anyone tell me the correct approach or a sample code to diaplay this date in my jsp page.
    <%@ page language="java"
    import="javax.xml.parsers.*,java.io.*,org.w3c.dom.*"%><%@ page import="java.util.*" %>
    !DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html> <head> <title>Configuring Xml File</title>
    <SCRIPT LANGUAGE="JavaScript" SRC="xyz.js"> </SCRIPT>
    body bgcolor="#d0d0d0" onClick= "return getDate()" >
    <form name="f1">
    <b>20 october 2006 </b>
    Here where i am printing the date i had to get the value from the js function. how to do that. plz help me....

    Are you talking about server-side java code (servlets/jsp) or client side (applet)? Given we are in the JSP forum I'll assume we're talking server side.
    If so, you are making a common but fundamental mistake. JavaScript executes on the client, not on the server. If you want client data on the server it has to get there somehow. The simplest way to do this in JSP land is via HTTP. So... have your JavaScript code call a JSP (or servlet) and pass the value you want as a URL parameter. Of course this will also change the browser location, so if you don't want this to happen use a frame or iframe to capture your HTTP request.
    For example:
    Javascript....
    function someFunction() {
    return 1;
    var value = someFunction();
    location.href="somejsp.jsp?value=" + value;

  • How to get onChange functionlity in webdynpro java....?

    HI ALL,
    How to get onchange functionality(Like in HTML)  when i click on  inputfield(F4 -Help value) in web dynpro java . For Inputfield in Properties we are havaing only OnEnter Event only there . 
    Ex :
    I Have 3 Fields
    1. 2-  Inputfields and 1- F4 Help field
    when i click on F4 Help Field i want to show/Hide there remaining 2 - inputfields  based on selection.

    HI MOVVA.SRAVANI ,
       To get that F4 help functionality in WDJ you need to understand the OVS functionality. Please find the below link which could help you understand this functionality.
    URL:  http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/3073bc25-2c08-2d10-1e82-f6ed25001a13?QuickLink=index&overridelayout=true
    Re: Custom UI Elements?
    Regards
    Uday

Maybe you are looking for

  • Machine needs new OS; whither CS4?

    I've got CS4 faculty/student edition on a Dell laptop that's taken some pretty severe hits,  It still works if I don't close the cover (hinge damage), but there are also signs of malware here and there.  I'm retired faculty now (not emeritus) and can

  • Forms font chnages at runtime

    hey friends, The font of teh form changes at runtime. What it looks in forms builder is completely different at runtime. How to retain that font during run time also? Thanks

  • Scrabble App on AUS iTunes store missing Facebook Social Play option...

    Anyone have any ideas why the Scrabble App on AUS iTunes store is missing the Facebook Social Play option that the US iTunes store version of the Scrabble App has? And is there any word on if or when this might be addressed??

  • I need to flip a clip in the event library, not timeline. Is that possible?

    I have a clip that is upsidedown and want to flip it in the event library and then work on clips. Can I do that? Is all editing available in the event library? Also, when I flip my upsidedown image in the timeline (not where I wanted to do it), the t

  • Setting up yahoo e-mail on .mac account

    How do I setup my Yahoo e-mail account to be read from my .mac account when I open Mail program?