Making a system call

When I make a system call of the sort
Process theProcess = Runtime.getRuntime().exec(*my command here*);
Does the thread wait for the command to be executed, or does it keep on executing subsequent lines of code?

Does the thread wait for the command to be executed, or does it keep on executing subsequent lines of code? Write some simple test code and then report the results back here.

Similar Messages

  • Can I source an environment before making a system call from the database

    I can execute system calls from the database like
    Process proc = Runtime.getRuntime().exec("env");
    but I am unable to source an environment before making the call.
    Our goal is to from within the database to execute tkprof on a
    raw trace file then load both files into clobs in a table. We can load
    the raw trace no problem, we just cannot figure out how to execute
    tkrprof on the raw trace then load its output.
    Anyone know if this is possible to hava java get a runtime and then call
    an environment file to source the environment so that path's and other environment variables are set prior to executing another system command.

    Thanks for that...but can I do multiple edits in my Stored Procedure Vaibhav and pass back something that I can then utilize in my SSIS? For example...
    One and Only one Member Span...so I'd be doing a SELECT COUNT(*) based on my match criteria or handle the count accordingly in my Stored Procedure and passing something back via the OLE DB Command and handling it appropriately in SSIS
    Are there "Diabetes" claims...again probably by analyzing a SELECT COUNT(*)
    Am I expecting too much from the SSIS...should I be doing all of this in a Stored Procedure? I was hoping to use the SSIS GUI for everything but maybe that's just not possible. Rather use the Stored Procedure to analyze my stged data, edit accordingly, do
    data stores accordingly...especially the data anomalies...and then use the SSIS to control navigation
    Your thoughts........
    Could you maybe clarify the difference between an OLE DB Command on the Data Flow and the Execute SQL Task on the Control Flow...
    You can get return values from oledb comand if you want to pipeline.
    see this link for more details
    http://josef-richberg.squarespace.com/journal/2011/6/30/ssis-oledb-command-and-procedure-output-params.html
    The procedure should have an output parameter defined for that
    I belive if you've flexibility of using stored procedure you may be better off doing this in execute sql task in control flow. Calling sp in data flow will cause it to execute sp once for each row in dataset whereas in controlflow it will go for set based
    processing
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • Making Palm System calls using J2ME

    Hi is there anyway where I can use the old KJava API or even the J2ME to make system calls such as
    DmFindDatabase(0,"Something")
    SysAppLaunch(0,dbID,0,cmdPrintChars,theChars,&result);
    axlrose82

    [axlrose82],
    At the moment, we are quite certain that the kVM for the PalmOS do not contain any API that allows a developer to make system calls to the PalmOS itself. The CLDC/MIDP specification does not specify any native system calls access any of the native apps. I can see from your code that you are trying to access the Palm database but I'm afraid you are out of luck with the current specs.
    HTH.
    Allen Lai
    Developer Technical Support
    SUN Microsystems
    http://www.sun.com/developers/support/

  • Quotes in parameters to a system call

    Hello,
    From my program, which is a servlet, I'm making a system call using -
    (Runtime.getRuntime()).exec(cmd).waitFor();
    where cmd is a previously defined String giving the call to execute. The problem here is seen when the parameters to cmd (which happens to be a perl script in this case) include one or more where the values are strings which include spaces, and hence are in double quotes. For example, if I want to execute -
    /usr/local/bin/myScript.pl -t "Some text"
    When executed from a prompt this works fine and -t has the value -
    Some text
    However when called from my Java program as above, the script instead thinks that -t has the value -
    "Some
    I'm not sure how this is coming about, but it seems to be a feature of the way Java executes the command. Has anybody seen this before? How do I stop it happening? I have tried every combination of quotes of which I can think, but nothing seems to do what I want, and the command string when printed to screen, for example, looks exactly as it should.
    Thanks,
    Joe Partridge

    Or sat all separate parts in String[] like this:
    String[] cmds={"/usr/local/bin/myScript.pl","-t","Some text"}
    and call:
    (Runtime.getRuntime()).exec(cmds).waitFor();
    That also works and you don't have to remember to put quotes all the time
    Gil

  • Quick question about making system calls

    hello all
    i have a simple quick question regarding making system calls. Basically I want to mimic the command "system" for perl. I am not quite sure how to do this for java.
    any feedback would be appreciated.

    look at:
    java.lang.RunTime

  • Making system calls in java

    I want to join some split files into one. In command prompt I use COPY /B file.1+file.2 file to join the files. How can i do the same in my java application. Please show the code which I suppose will use getRuntime. Thanks in advance.

    Well if there is a problem with system calls then can
    you tell me if there is a class in java for
    concetanating files. Not directly.
    At present I am joing the files
    by reading each byte from the files and writing them
    to another file which takes hell lot of time. You should read the files in large chunks. Much much faster.
    Thanks
    in advance again. Also if you say about sequential
    file class then please expalin a bit bcs I couldn't
    implement it.Post the code you are having trouble with explaining what it should do and what it actually does.

  • Adding menu items and making system calls in AfterEffects (AE,CS3)

    We are looking to do the following things via javascript in AfterEffects CS3. It does seem straight-forward, but am unable to find a good reference or example.
    * Add at startup a menu item under "File" (or similar main menu) and have it call a script function when clicked.
    * Have a script make an external system call (to launch an external application/executable with a few parameters)
    Any insights on how to achieve this?
    Many thanks!

    I wanted to see if there was any update on this, I'm writing a series of tools and would love to create a custom menu for quick and easy access.
    If it turns out there isn't an "easy" way to do this (env variables, special directory locations, javascripts) would anyone know if access to the menubar is possible from the Plugin API?
    I'm fairly new to After Effects, just getting up-to-speed on the environment now... seeing if I can duplicate the functionality of some old Nuke scripts in AE.
    thanks,
    Rick_

  • Making system calls in Flex

    - Can I make system calls to access the local file system? If
    so, is there a sample?
    - Can I make system calls to run local console
    scripts/binaries and get the output back? If so, is there a sample?
    Thanks,

    "Greg Lafrance" <[email protected]> wrote in
    message
    news:gd8flp$sul$[email protected]..
    > To be fair, Adobe's initial vision for AIR is not as a
    technology that
    > would
    > permit you to create desktop apps that do all that
    "regular" desktop apps
    > do.
    >
    > Part of the reason is because they wanted to have a
    solution that "starts"
    > to
    > blur the lines between online and desktop, but I suspect
    another reason is
    > because they wanted to get it out the door, and dealing
    with the
    > additional
    > security considerations might delay that.
    >
    > That said, I'm right there with you, I am looking
    forward to when AIR apps
    > can
    > execute native apps.
    >
    > One of the problems is that Adobe has "grown up" and now
    is getting a
    > touch
    > stiff, though I still believe they will continue to be
    one of the greatest
    > software firms out there for the next 5 - 10 - 15+
    years.
    >
    > Of course I work there, so I'm at least a bit biased.
    But then again, I am
    > a
    > bit of a rebel against some aspects of Adobe (and
    definitely against some
    > aspects of the former Macromedia) culture.
    Heh. Been there, done that. They stopped giving me t-shirts

  • Why the apple told about this system for the new iphone 6 but the mine no see the change...?1:28 p.m. Wi-Fi calling is a new feature for making high-quality calls when cell conditions are poor.

    Hi apple. in the Keynotes about the new iphone you say..
    1:28 p.m.
    Wi-Fi calling is a new feature for making high-quality calls when cell conditions are poor.
    The question is Work That? i no see the change for me POOR signal here on my office..
    my carrier att. have very Poor Signal here on Aguadilla PR.. i take this PHone for this keynotes about the wifi calling is a new feature...
    please i need a new respont.. and check the security about iphone Someone call reply the text messenger from the Block area.

    It sounds as if you only had one line with an upgrade available. So you can only upgrade one line. For you to upgrade as well, you will have to wait until your upgrade is available. You can check that at MyVerizon. That's just how it works. All carriers and phone brands are the same. I have to wait until February to upgrade. The only thing you can do to get the new iPhone, is add a new line. But then you're paying for a line you don't need.

  • Third party system call function module/BAPI through RFC to update Z table

    Dear Friends,
    We have a third party system which directly inserts a Z table in SAP through its programming, which is an auditing issue.
    We want the third party system should call function module/BAPI through RFC so that the Z table gets updated.
    waiting for inputs..
    Thanks,
    Kumar

    if third party system is capable of making Remote Function call, then writing a Function module & making it remote enable is not difficult task in ABAP.
    You may have to prepare specifications first to decide if third party system is going to Read, insert, update, delete records from Zee table.

  • Write system call results to a text box

    I am making a DOS system call that creates a file. Once this file is created it gives me a "packet created successfully" message that is written to the screen.
    I am using Netbeans 5.5.1 and Swing. and I want this message to be output into a JtextArea. The system call works fine and the file is created, I just can't get the message to write to my text area.
    Below is a sample of my code:
    private void btn_importActionPerformed(java.awt.event.ActionEvent evt) {                                          
    // TODO add your handling code here:
         String Rep = txt_Repname.getText();
         String Work = txt_Workdir2.getText();
         String VOB = txt_VOBtag.getText();
         String VOBstorage = txt_VOBName2.getText();
         String Replicapath = txt_Replicapath.getText();
         String command = ("cmd /c multitool mkreplica -import -npreserve -nc -vreplica " + Rep + " -work " + Work + " -tag \\" + VOB + " -vob " + VOBstorage + " " + Replicapath);
         StringBuffer sb = new StringBuffer();
         Process p = null;
         try {
                p = Runtime.getRuntime().exec(command);
            } catch (IOException ex) {
                ex.printStackTrace();
        Scanner s = new Scanner(p.getInputStream());
        while(s.hasNextLine()) {
            sb.append(s.nextLine()+"\n");
        String result = sb.toString();
        txt_Importresults.setText(result);
        }           

    This works okay for me.
    import java.io.IOException;
    import java.util.Scanner;
    public class Tester {
         public static void main(String[] args) throws IOException {
               StringBuffer sb = new StringBuffer();
              Process p = null;
              try {
                     p = Runtime.getRuntime().exec("HELP");
                 } catch (IOException ex) {
                     ex.printStackTrace();
             Scanner s = new Scanner(p.getInputStream());
             while(s.hasNextLine()) {
                 sb.append(s.nextLine());
                 sb.append(System.getProperty("line.separator"));
             System.out.println(sb.toString());
    }Have you read the Traps article on JavaWorld?
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

  • Making a VoIP call with the Cisco 837 ADSL router

    I would greatly appreciate if could please provide some technical assistance to my questions below:
    Is it possible to make a VoIP call between two 837 ADSL Cisco routers over a 1Mbps ADSL broadband connection?
    If so, can I configure this VoIP connection using either a PPPoE or ATM WAN link?
    Is it possible to make a VoIP call using a Cisco 837 Router while simultaneously surfing the Internet? In other words do I need two public IP addresses i.e. one for accessing the internet and one for making the VoIP call or is one static IP address obtained from my ISP sufficent.
    It is possible to configure QoS parameters (e.g. RSVP, Voice precedence, Voice codec selection) on this 837 router using PPoE or can it only be done using an ATM WAN interface?
    Does the Cisco 837 router support both the H.323 and SIP communication protocols? Do I need to purchase a certain IOS operating system version for VoIP calling?
    Does the VoIP dial peers need to be configured with both a POTS and VoIP phone numbers or is only one number required?
    Do I need to obtain a special VoIP number from my VoIP service provider? or can I use existing POTS numbers or made up numbers within the dial peers as this situation involves making a private VoIP call between two branch offices using 837 ADSL routers and not via a VoIP service provider.
    Finally, can I use POTS ordinary telephones with the Cisco 837 for making VoIP calls or do I strictly need to purchase VoIP phones?
    My apologies for the number of questions asked here but I currently need to know the technical ability of the Cisco ADSL 837 as I am thinking of employing these routers in my company organisation.
    I await your feedback in due course.
    Thanks,
    Martin Healy

    Hi,
    I give you a sample config of my router.
    class-map voice
    match access-group 101
    policy-map mypolicy
    class voice
    priority 128
    class class-default
    fair-queue 16
    ip subnet-zero
    gateway
    interface Ethernet0
    ip address 20.20.20.20 255.255.255.0
    no ip directed-broadcast (default)
    ip route-cache policy
    ip policy route-map data
    interface ATM0
    ip address 10.10.10.20 255.255.255.0
    no ip directed-broadcast (default)
    no atm ilmi-keepalive (default)
    pvc 1/40
    service-policy output mypolicy
    protocol ip 10.10.10.36 broadcast
    vbr-nrt 640 600 4
    ! 640 is the maximum upstream rate of ADSL
    encapsulation aal5snap
    bundle-enable
    h323-gateway voip interface
    h323-gateway voip id gk-twister ipaddr 172.17.1.1 1719
    h323-gateway voip h323-id gw-820
    h323-gateway voip tech-prefix 1#
    router eigrp 100
    network 10.0.0.0
    network 20.0.0.0
    ip classless (default)
    no ip http server
    access-list 101 permit ip any any precedence critical
    route-map data permit 10
    set ip precedence routine
    line con 0
    exec-timeout 0 0
    transport input none
    stopbits 1
    line vty 0 4
    login
    voice-port 1
    local-alerting
    timeouts call-disconnect 0
    voice-port 2
    local-alerting
    timeouts call-disconnect 0
    voice-port 3
    local-alerting
    timeouts call-disconnect 0
    voice-port 4
    local-alerting
    timeouts call-disconnect 0
    dial-peer voice 10 voip
    destination-pattern ........
    ip precedence 5
    session target ras
    dial-peer voice 1 pots
    destination-pattern 5258111
    port 1
    dial-peer voice 2 pots
    destination-pattern 5258222
    port 2
    dial-peer voice 3 pots
    destination-pattern 5258333
    port 3
    dial-peer voice 4 pots
    destination-pattern 5258444
    port 4
    end

  • Unix System Calls using Java

    Hi!
    Can anyone tell me how to do Unix System Calls in my Java program?
    If possible please give me the java code for it taking one unix system call as an example.
    Thanks in advance
    Raj

    do you mean firing off a shell command, or making actual kernel API calls or C library calls?
    for shell commands, have a look at Runtime.exec(). for kernel calls, use JNI. the JNI FAQ mentions something called "shared stubs" that may be of use:
    http://java.sun.com/products/jdk/faq/jnifaq.html
    cheers,
    p

  • Work Process tries to restart but fails - Operating system call fork:restar

    Hi
      We have a ECC 5.0 system running on v5r4 (6.40 kernel level 159).  Some of the work processes fail and then try to restart and fail again. Thus there are many job log entries in both SAP and OS/400.
    The OS/400 logs mention the PASE (unix executable environment) and MCH3203.
    SAP mentions Operating system call fork:restart
    OSS has note #884359 which mentions a palitative but despite being at 6.40 level 159 the parameter profile as/4/wp_max_restart is said to be "unknown" by RZ10.
    We are making sure we are up to date with the APAR II14126 just in case this is the issue.
    It did start after the time change but we are not sure this is the root cause.
    We are also considering getting upto kernel 171.
    Anyone else seen this issue?
    thanks
    Matthew Milne

    We see those problems once a while, and usually they are gone when you restart the instance or after an IPL. You should report the problem to IBM, they will probably be interested in the LIC log entries that come along with the error (STRSST - Start a Service Tool - Licensed Internal Code Log). II14126 is probably a good start (for example, MF40759).
    The profile parameter as4/wp_max_restart is only known to the kernel, because it is not intended as a permament setting, but only as a temporary workaround for the problem in the PASE environment. That's why RZ11 does not know about the parameter and reports it as unknown.
    Kind regards,
    Christian Bartels.

  • System call module questions.

    Hello,
    I am trying to create a system call module for solaris 2.6 (sparc).
    I am trying to avoid useing the /etc/name_to_sysnum file because I dont want my system calls to be dependant on a userland file. What I have done is this.
    static struct modlmisc modlmisc = {
    &mod_miscops,
    "Einstien system call driver"
    static struct modlinkage modlinkage = {
    MODREV_1,
    &modlmisc,
    NULL
    int
    _init(void)
    int error;
    if ((error = mod_install(&modlinkage)) < 0)
    return error;
    sysent[SYS_secctl].sy_narg = 6;
    sysent[SYS_secctl].sy_callc = (longlong_t (*)()) test;
    sysent[SYS_secctl].sy_flags = SE_LOADED | SE_NOUNLOAD | SE_ARGC;
         return 0;
    And this works, the only side effect is that my system calls do not have return values. Is there something else that I need to do (without makeing a specfic system call driver that depends on /etc/name_to_sysnum) to have correct return values ?

    See the Runtime class.
    http://java.sun.com/j2se/1.5.0/docs/api/index.html
    Also see the "gotchas" of using that class.
    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html

Maybe you are looking for