Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

How can you read from a process?

  Asked By: Harley    Date: Jul 10    Category: Java    Views: 480
  

I want to be able to run an Win32 console application like this....

String[] cmd = {OracleHome + "\\sqlplus.exe", UserPass
+ "@samsdb,@..."};
try
{
Process p = Runtime.getRuntime().exec(cmd);

OutputStreamWriter sqlout = new OutputStreamWriter
(p.getOutputStream());

BufferedWriter sqlread = new BufferedWriter(sqlout);
BufferedReader sqlprt = new BufferedReader(sqlread);

while ((sqlprt.readLine()) != null)
{
text.append(sqlplsout);
}
}
catch(IOException e)
{}
I know the code is incorrect but I wanted to convey the idea.
Do console apps automatically have there STDOUT go to another console
window?
Can I redirect it to a java GUI?
Should I just use JDBC behind the GUI to perform the PL/SQL?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 
Didn't find what you were looking for? Find more on How can you read from a process? Or get search suggestion and latest updates.




Tagged: