• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Tim Cooke
  • Devaka Cooray
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
Bartenders:
  • Carey Brown
  • Roland Mueller

Redirecting System.out to a String??

 
Ranch Hand
Posts: 200
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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).]
 
Bartender
Posts: 783
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Saj,
What ORACLE API are you calling? Does the method accept an PrintStream reference?
-Peter
 
The two armies met. But instead of battle, they decided to eat some pie and contemplate this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic