I want to check whether a system exists in LAN or not and also the database residing in that system is up or not.So, for this I'm trying to use telnet command as follows,

Runtime rt=Runtime.getRuntime();
Process p=rt.exec("telnet");

No error nothing ,It is executing .But by using the above command I don't know how to retrieve the success status .

Please,tell me a solution for this or is there any other way to solve this problem .


I think you will need to use the getInputStream() and getOutputStream() methods in the Process class to be able to do what you want to do. Basically you can use the I/O streams to communicate with the Process and then you can use the output from the Process to work out whether your command is successful. This might require a bit of trial and error, so I'll leave you to have a go at it.

We have develop a telnet client and remote server we are facing a problem with telnet command how to execute telnet comand in windows....