Hey Folks,
Can any body tell me that how do i excute java program from asp.net? Does any body knows about it? Kindly provide me the correct logical solution for the above issue. Any kind of help on the above issue would be appreciated.
Thanks.
Hey Folks,
Can any body tell me that how do i excute java program from asp.net? Does any body knows about it? Kindly provide me the correct logical solution for the above issue. Any kind of help on the above issue would be appreciated.
Thanks.
This sample Java Program executes the 'dir' command reads the output of the dir command prints the results. This is just for understanding the concept, however, you may execute just about any command using this Runtime.getRuntime().exec() command.
import java.io.*;
public class doscmd
{
public static void main(String args[])
{
try
{
Process p=Runtime.getRuntime().exec("cmd /c dir");
p.waitFor();
BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
String line=reader.readLine();
while(line!=null)
{
System.out.println(line);
line=reader.readLine();
}
}
catch(IOException e1) {}
catch(InterruptedException e2) {}
System.out.println("Done");
}
}
jTask is a java applet which can execute java classes unattended and in a scheduled manner. This can execute any Java class with a main() method. It requires no special sub-classing or interface, so you can use any of your existing utilities without having to recompile them. Any DBA, Network Admin, or System Admin who is fluent in Java will find scheduling in this very easy. It supports features like built in logging capabilities, error notification on desktop or via email, flexible repetition (minute, day, week etc.), suppress execution before/after a specific date and time, invoke any Java class with a main() method, automatically detects when classes are re-compiled, includes wrapper class for running Windows EXE's.
Bookmarks