wood burning stoves 2.0*
The moose likes JDBC and the fly likes How to output from a java program called from PL/SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How to output from a java program called from PL/SQL" Watch "How to output from a java program called from PL/SQL" New topic
Author

How to output from a java program called from PL/SQL

Tony Evans
Ranch Hand

Joined: Jun 29, 2002
Posts: 556
I am getting this error
ORA-06502: PL/SQL: numeric or value error trying to return a java string>

from this code

p = rt.exec("echo "+envar);

BufferedInputStream bis = new BufferedInputStream(p.getInputStream());
while ((len = bis.read(buffer, 0, bufSize)) != -1)
{
System.out.write(buffer, 0, len);
}
path = new String(buffer);
//p.waitFor();
return path;

Is there a way to get it to output the code or do I have to open a file within my program and write to it for debug purposes.

Thanks for any help

Tony
Jeanne Boyarsky
internet detective
Marshal

Joined: May 26, 2003
Posts: 29249
    
139

Tony,
Are you trying to ouput the oracle error code or your source code?


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Tony,
Visit the JVM forum where I answered this very same question that you also posted over there.

Good Luck,
Avi.
 
Consider Paul's rocket mass heater.
 
subject: How to output from a java program called from PL/SQL
 
Similar Threads
A problem with servlet file transfer
Calling a java object fromn a store procedure no idea how to get it to work
reading byte array
Calling the UNIX API
Permission problem calling java from PL/SQL