0

Hi everyone,
I wrote the below small code to run one command line argument in my program but somehow couldnt understand how to store or retrieve the output generated by that command line.So i would be very thankful if someone helps me with this.

Runtime rt = Runtime.getRuntime();
Process pr = rt.exec("dbentry -i 1234 -U loclucmed09");

Regards,
aru211285

Edited by aru211285: n/a

2
Contributors
3
Replies
4
Views
8 Years
Discussion Span
Last Post by masijade
0

Thanks for teh reply. But here i found that read can give me only an integer but the output what im expecting is a string(text of 4-5 lines). When i tried using converting integer to string its giving me some number but not the output string.

0

I said read it, not, literally, use the read method. See the API docs for InputStream, and read that article I posted, and more things will come clear to you. There are a plethora of code examples in that article, as well.

And that "int" is a byte value. Once again, read the API docs and that article.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.