Home » Developer & Programmer » JDeveloper, Java & XML » "No such file or directory" using java.io
"No such file or directory" using java.io [message #91557] Thu, 07 November 2002 14:06 Go to next message
Chris Wood
Messages: 2
Registered: November 2002
Junior Member
I have the following code:

public class CWoodTest {

public static String go(){

file = new File( "/data/oracle/testfile.dat" );
String result = null;
File file = null;

try{

FileWriter fileWriter = new FileWriter( file );
fileWriter.write("Working");
fileWriter.close();

} catch( Exception e ){

if( file != null)
result = e.getMessage() + " " + file.toString();
else
result = e.getMessage() + " file null";

}

if( result != null ) return result;
else return "Working";

}

}

and publish it as

CREATE OR REPLACE PACKAGE CWoodTest AS

FUNCTION go
RETURN VARCHAR2
AS LANGUAGE JAVA
NAME 'CWoodTest.go() return java.lang.String';

END CWoodTest;
/
show errors

that returns "No such file or directory", though my user has JAVAUSERPRIV and JAVASYSPRIV and /data/oracle is owned by the user oracle. UTL_FILE is able to write to /data/oracle, i.e. UTL_FILE_DIR is correct in init.ora. Similar Java code works on my local machine. Ideas anyone?
Re: "No such file or directory" using java.io [message #91559 is a reply to message #91557] Fri, 08 November 2002 06:20 Go to previous message
Chris Wood
Messages: 2
Registered: November 2002
Junior Member
nevermind - I found the problem.
Previous Topic: Re: sample test questions for OCP exams IZO-501/502/504/505
Next Topic: Re: Orcale + JAVA
Goto Forum:
  


Current Time: Tue Nov 26 10:02:24 CST 2024