This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
Hi, Wanted to know if there was a way i could fire a statement into command prompt and display the results on a label((eg. c:\>ping 172.16.2.214) and display the results of the ping response on a label(which is refreshed every 50 milliseconds)).Displaying the results can be done by capturing the response in a .txt file and maybe using a threaded IO operation and readind the response onto a label. Purpose of me doing this is, i want to fire a logical backup of the database from the front-end, similarly restoration of the database from the front-end.. Like incase of VB 6.0, I could give a Shell command and the statement would be executed in the command prompt. Thanx All..
Your question should go into "Java in general" forum.
Use one of the exec() methods of java.lang.Runtime class to execute an external application or o/s command. The exec methods return an instance of Process class, which can be used to obtain the standard i/o related to the executing process.
Here is a quick example.
A google search with "java runtime exec process" brought me some useful results. [ March 23, 2005: Message edited by: Susanta Chatterjee ]
Joined: Mar 23, 2005
hey thanx for the reply !! i will try it in sometime, will keep u updated sorry for having posted it in 2 differnt sections. Will keep u posted abt my progress Take Care