Call visual prolog program from java

Hi friends,
is there someone help me to call ( run) prolog program from java.
i write a parser with Javacc parser generator and stored parsed information in prolog database and I want create some query in java that work in the prolog file.
how can i combine java and prolog programs. i used visual prolog.
Can someone help me?
Thanks you in advance.
yours sincerely,
ksu

Since visual prolog can produce dll's, you can use JNI:
http://java.sun.com/j2se/1.4.2/docs/guide/jni/index.html

Similar Messages

  • How do I call a C++ program from Java?

    I've tried using Runtime.exec to call my C++ program from Java but I don't think I'm doing it correctly. Could someone explain how to properly use it? Here's what I'm trying (this is in an applet that is only going to be running on an intranet so only PCs in my LAN will be affected):
    Runtime runtime=runtime.getRuntime();
    Process proc =runtime.exec("mkdir C:\\Test");

    What do you expect your operating system should do with a command "mkdir"? It doesn't understand this. "mkdir" is a shell command, so you need to execute the shell:
    runtime.exec("cmd /c mkdir C:\\test");

  • How to Call abap functn/program from java layer

    Hi all,
        I have to develop a program which has to call abap function/program from java side or how to call a abap program through java ..
    pls send me related links or explanations.. dont send unrelated answers..
    Regards,
    Arivarasu S

    Hi,
    You mean accessing ABAP functions from J2EE perspective, then I think we can do this by using SAP Java Resource Adapter and also through webservices.
    SAP Java Resource Adapter (SAP JRA) can be used as an add-on for the SAP JCo SAP JRA enables the implementation of standard interfaces from diverse J2EE servers to the SAP JCo in the SAP Web AS. The SAP JRA thus simplifies
    communication with ABAP within heterogeneous J2EE landscapes.
    Go through the following links which has Good documentation on how to achieve this
    Accessing BAPIs Using the SAP Java Resource Adapter
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ad09cd07-0a01-0010-93a9-933e247d3ba4]
    Connectivity and Interoperability
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/326d82e5-0601-0010-fca4-9caf27b89c26]
    Finally with WebServices. Accessing SAP Business Functions (ABAP) via Web Services
    [https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/06adbf03-0a01-0010-f386-d8e45561a3c4]
    Regards
    Raghu

  • Calling a C program from Java

    is there a way we can supply those command arguments when say we click a button, and the command argument is somthing like
    "server test.txt output.txt"
    where server is an executable ".exe" written in C and test.txt is the input file while output.txt is the output file..
    bottom line... can java call a C program within a GUI ??
    is that possible?
    is it the only way through: Runtime.exec() ?
    thank you very much

    my c program is an exe..
    i tried to execute the program using runtime.exec but faced problem..please help..
    im using the StreamGobbler from: http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    try
    String fileinputstring = "./outputfile/input.dat";
    FileInputStream fis = new FileInputStream(fileinputstring);
    FileOutputStream fos = new FileOutputStream("./out/test/myfile");
    Runtime rt = Runtime.getRuntime();
    Process proc = rt.exec("./out/server.exe " + fileinputstring);
    StreamGobbler errorGobbler = new StreamGobbler(proc.getErrorStream(), "ERR", null);
    StreamGobbler outputGobbler = new StreamGobbler(proc.getInputStream(), "OUT", fos);
    errorGobbler.start();
    outputGobbler.start();
    int exitVal = proc.waitFor();
    System.out.println("Exit Value: " + exitVal);
    fis.close();
    fos.flush();
    fos.close();
    catch(Throwable t)
         t.printStackTrace();
    }basically if my c program is to be run from the command prompt it would be:
    server outputfile/input.dat out/test/myfile
    my problem is that the file in out/test/myfile should contained the output that is generated from server...
    my code actually correctly print out the output i wan to see on screen but doesn't write the c output onto "myfile"...so i wonder whether i executed my program correctly this way..
    please help...thanks

  • Calling Same C program from Java Classes

    Hi!
    Can anyone let me know how to call the same C program using JNI from multiple Java Classes/programs?.
    Cheers
    Sai

    JNI creates a shared library.
    Any application that needs to can use the shared library at the same time.
    Ideally you use the same interface that you created for one application via JNI in the other applications.

  • Error in calling 'C'  Program from Java

    Hi,
    We developed a 'C' Program and during compilation, we got a couple of Incompatible Prototype warnings. Then we made a Jni call to 'C' program from Java Program. The program returned a "Unsatisfied Link Error - unreference Symbol not found" error.
    Does Jni call fails owing to warnings by compiler?
    We are using Sun Solaris 2.8.
    Request your assistance as this a urgent issue.
    Thanks
    Srini

    Did you try running your C program through g++? It sounds like something is broken, but GCC often will allow you to compile anyways.
    -Jason Thomas.

  • Problem while Calling a CGI pgm From Java with code sample

    Hey guys,
    I am calling a CGI program from java servlet, while calling cgi program I am passing encoded(Base64) content via post process,
    My problem is the encoded data is not posted as expected, the encoded data is corrupting. But when I send encoded data in a text file, cgi program is perfectly decoding and working fine.
    Here I am doing Base64 encoding as per requirement, I cannot avoid this encoding.
    My doubt is about OutputStreamWriter constructor argument , In OutputStream Constructor I am passing one argument is OutputStream object and another argument is encoding type. I tried with ASCII, US-ASCII & UTF-8 .
    My code is as follows, please help me to resolve this issue.
    URL url = new URL("CGI server path");
    URLConnection urlConnection = url.openConnection();
    urlConnection.setDoOutput(true);
    OutputStream os = urlConnection.getOutputStream();
    BufferedOutputStream buffer = new BufferedOutputStream(os);
    OutputStreamWriter  writer = new
                                                   OutputStreamWriter(buffer, "US-ASCII");
    writer.write(encodedPDF-Content);
    writer.write("\r\n");
    writer.flush();
    writer.close();
    here encodedPDF-Content is String and it's size is 9565 bytes

    Whenever you read something in java into string (with Reader implementation) it expects source to contain text in encoding you specified. It then decodes it and makes 16 bit unicode string from it. Whenever you store string using Writers it does reverse operation with specified encoding (may be different than this which you used to read source) and stores text as a sequence of bytes made of 16 bit unicode string. So, passing text back and forth between programs with the help of files or I/O you can make mistake at both reading and writing encoding. Check for it.
    Now, when C programm or other application reads file it may take another assumptions about encoding or may even completly ignore it and read source as a binary file. Then, if you have a source text as a file and have to pass it to other application never do it using Reader/Writer. User raw InputStream/OutputStream instead what will preserve all information unchanged.
    here encodedPDF-Content is String and it's size is 9565 byteHow id you get this info? String.length() gets you how many chars is in it, it will be half the number of bytes. If you see your input file beeing 9565 bytes long, see my above statements.

  • Calling a CGI pgm From Java

    I am calling a CGI program From Java using URL class and I am passing a pdf file under post process. The Content I am appending by Base64 encoding, the CGI program will decode it and print the content
    When I send this Content the content is correpting. When CGI program is decoding it is not getting expected content. But the CGI program is working fine If I send that encoded content in a text file.
    When I send the encoded content in a text file as attachment OR put in a common drive, the CGI program is working fine. Only I am facing problems when I send this content via post process using URL class.
    Why it is happening like this? Is anybody can help me to Resolve this problem?

    Just a guess: are you sure the content-type header is correct?

  • Calling C code (exe ) from Java program

    Hi all,
    kindly help in giving a solution for calling C code (exe ) from Java program, i will be very thank full to u if any body can help in sending a code example
    bye

    You might need to consume the io operations on the Process...
    An excerpt from java.lang.Process:
    All its standard io (i.e. stdin, stdout, stderr) operations will be redirected to the parent process through three streams (Process.getOutputStream(), Process.getInputStream(), Process.getErrorStream()). The parent process uses these streams to feed input to and get output from the subprocess. Because some native platforms only provide limited buffer size for standard input and output streams, failure to promptly write the input stream or read the output stream of the subprocess may cause the subprocess to block, and even deadlock.

  • How to call a VB application from Java

    Hi,
    does anybody know how to call a VB application from java.
    Would appreciate if you can provide me with an example.
    thanks

    try exec()ing the cad program with the name of the file as a command line parameter...
    Runtime.getRuntime().exec("CADProg.exe Test.prt");
    i have no clue if this will work but it seems like it's worth a try.

  • Read the output of the iseries CL Program from Java

    I have a Java program running on the iseries(AS400). I need to call a CL program from this JAVA.I have to pass 7 arguments to it.Out of 7, three are input parameters to CL and other 4 are its output parameters to the calling JAVA program. I am using Runtime.getRuntime().exec(arguments) to call the CL. Please suggest me how to read the output from the CL in the JAVA program.

    http://www.javaworld.com/javaworld/jw-12-2000/jw-1229-traps.html
    Kidding:
    If a method has at least 7 parameters, chances are one or two have been forgotten.

  • Call an ABAP Program from Web Application designer

    Hi Gurus,
    I have an requirement in which I need to fetch an CSV file from the server and place the file into an internal table in R/3.I got the function module and wrote the program for this,but now I need to call this ABAP program from Web Application designer.
    To make it more explicit ,I need to call an ABAP Program /function module from the WAD.I am new to WAD Please help.
    Ankit

    Hi Ankit,
    take a look:
    /thread/725385 [original link is broken]
    WAD and ABAP
    How to call a ABAP or ABAP Class from the WEB
    /people/kai.wachter/blog/2008/03/11/how-to-write-own-items-in-bi-70-java-runtime
    Regards
    Andreas

  • How can i call forpro prg file from java

    Hai friends,
    I have a doubt,clear it.
    how can i call forpro prg file from java file
    by,
    N.Vijay

    Thanks to your reply,
    I have some print statements in my foxpro program file.
    Then i like to invoke that foxpro file from my java file
    This want i want..,
    by,
    N.Vijay

  • I need to call a batch file from java and pass arguments to that Batch file

    Hi,
    I need to call a batch file from java and pass arguments to that Batch file.
    For example say: The batch file(test.bat) contains this command: mkdir
    I need to pass the name of the directory to the batch file as an argument from My Java program.
    Runtime.getRuntime().exec("cmd /c start test.bat");
    How to pass argument to the .bat file from Java now ?
    regards,
    Krish
    Edited by: Krish4Java on Oct 17, 2007 2:47 PM

    Hi Turing,
    I am able to pass the argument directly but unable to pass as a String.
    For example:
    Runtime.getRuntime().exec("cmd /c start test.bat sample ");
    When I pass it as a value sample, I am able to receive this value sample in the batch file. Do you know how to pass a String ?
    String s1="sample";
    Runtime.getRuntime().exec("cmd /c start test.bat s1 ");
    s1 gets passed here instead of value sample to the batch file.
    Pls let me know if you have a solution.
    Thanks,
    Krish

  • How to call a concurrent program from a Custom JSP page.

    Hi,
    I have a custom JSP page which i have deployed by creating a form function with the path of the JSP Page
    and added the JSP Page to the OA_HTML top.
    Now, i need to call a concurrent program from the JSP Page, i have all the parameters in my page and i am using the standard class as below:
    ConcurrentRequest cr= new ConcurrentRequest(con);
    int requestId= cr.submitRequest("XXINV",programName,null,null,false,vec);
    I have verified my connection object and it is OK but i am getting the exception that user is not set to run the program.
    I tried the below code in my JSP page and getting -1 for all test variables :-
    int userId = wctx.getUserId();
    int respApplId = wctx.getRespApplId();
    int respId = wctx.getRespId();
    I think i need to set the context in JSP page to run the program..
    Pls help ....
    Regards
    Saurabh Jaiswal

    Hi,
    Thanks for the reply,,,
    This is a possible solution but this will allow to run the program anyhow.
    But the procedure which i call thru callable statement will start with
    fnd_global.apps_initialize (3825, 50603, 704);
    fnd_request.submit_request API call.
    Now, the values of user and Responsibilty is required in the program and it changes.
    With this approach we have to hardcode the user and resp.
    The same JSP page is attached to other responsibilities and there the concurrent program would get fired as if fired from the resp Id hardcoded as above.
    Need to capture user Id and RespId.
    How can i set the apps Context in JSP page???
    Regards
    Saurabh Jaiswal

Maybe you are looking for