my code is something like this .....................
-
//MyThread.java
-
package com.iitkgp.coalnetpim.util;
-
-
import java.io.*;
-
-
public class MyThread implements Runnable
-
{
-
private Thread t;
-
private String command;
-
public Process NATIVE_PROCESS = null;
-
public InputStream final_output = null;
-
public int exitVal = Integer.MIN_VALUE;
-
public String error_string = null;
-
public MyThread(String command)
-
{
-
this.command = command;
-
t = new Thread(this);
-
t.start();
-
}
-
public void run()
-
{
-
try
-
{
-
NATIVE_PROCESS = Runtime.getRuntime().exec(command);
-
//Thread.sleep(5000); //Keep it slept for 5 seconds so that the browser can get the intial response
-
/*exitVal = NATIVE_PROCESS.waitFor();
-
if(exitVal == 0) final_output = NATIVE_PROCESS.getInputStream(); //Normal termination
-
else final_output = NATIVE_PROCESS.getErrorStream(); //Abnormal termination*/
-
}catch(Exception e)
-
{
-
error_string = e.fillInStackTrace().toString();
-
}
-
}
-
public boolean isAlive()
-
{
-
return t.isAlive();
-
}
-
}
-
At first the link called the TestThread.jsp...
The comment line i first tried to execute but the expected output i didn't get......
the ThreadTest.jsp starts the thread and will show the current process status
the ThreadTestHidden.jsp will looks after the process by sending request in every two minutes.
and the command run on the solaris is ....
sh /user6/oracle9iAS/coalnet_screen_backup/backup_from_screen 2 a0d1m4 mms
2 is for module choice
and mms for module name
the module contains thousands of tables and other objects such as procedures....etc...etc.......
the scripts are ...........
-
//backup_from_screen
-
choice=$1
-
case $choice in
-
1) adm_password=$2
-
sh /user6/oracle9iAS/coalnet_screen_backup/all_backup_db $adm_password ;;
-
2) module_codes=$3
-
adm_password=$2
-
sh /user6/oracle9iAS/coalnet_screen_backup/module_backup_db $module_codes $adm_password ;;
-
-
3) module_codes=$3
-
adm_password=$2
-
table_names=$4
-
sh /user6/oracle9iAS/coalnet_screen_backup/module_backup_tables $module_codes $adm_password $table_names ;;
-
4) sh /user6/oracle9iAS/coalnet_screen_backup/application_complete ;;
-
5) module_codes=$2
-
sh /user6/oracle9iAS/coalnet_screen_backup/application_module $module_codes ;;
-
esac
-
echo "Backup Done"
-
plz help me out after see my reply......................
thhhhhhhhhhhannnnnnnnnnnnnnnnnnkkkkkkkkkkkkkkkksss ssssss.................