Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Redirecting System.out to a String??  RSS feed

 
Sajee Joseph
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I have a problem here. In my code i am calling an Oracle API, which prints its output to PrintStream and by default it is System.out. console. Now what i want is i want to redirect this output to a String variable. I know that i can set the output of System.out to a file and then read the contents of this file to a String. But i dont want to do all these file operations as it will consume time. Is there any other means?? Pls help me out.
Also after i redirect System.out to my own stream and after my purpose is served, how do i redirect System.out back to the console??
Happy new Year!!!
Warm Regards
Saj
[This message has been edited by Sajee Joseph (edited January 01, 2002).]
[This message has been edited by Sajee Joseph (edited January 01, 2002).]
 
Peter Tran
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Saj,
What ORACLE API are you calling? Does the method accept an PrintStream reference?
-Peter
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!