Home » Developer & Programmer » JDeveloper, Java & XML » Java error
Java error [message #91646] Thu, 26 December 2002 11:14 Go to next message
Eugene
Messages: 44
Registered: August 2001
Member
Hi all,
I am using Oracle 8.1.7 on NT 4
Trying to read a directory using Java procedure, but getting the following error:

ORA-29532: Java call terminated by uncaught Java exception: java.lang.NullPointerException
ORA-06512: at "UB_OBJECTS.GET_DIR_LIST", line 0
ORA-06512: at line 7

Here is what i am running:

CREATE OR REPLACE AND RESOLVE JAVA SOURCE NAMED DirList AS
import JAVA.io.*;
import JAVA.SQL.*;

PUBLIC CLASS DirList
{
PUBLIC STATIC void getList(String DIRECTORY)
throws SQLException
{
FILE path = NEW FILE( DIRECTORY );
String[[]] LIST = path.LIST();
String ELEMENT;

FOR(INT i = 0; i < LIST.LENGTH; i++)
{
ELEMENT = LIST[[i]];
#SQL { INSERT INTO dir_list (FILENAME)
VALUES (:ELEMENT) };
}
}

}
/

CREATE OR REPLACE PROCEDURE Get_Dir_List( p_directory IN VARCHAR2 )
AS LANGUAGE JAVA
NAME 'DirList.getList( java.lang.String )';

Then I just run it for '/temp'

Your help is greatly appreciated,
Re: Java error [message #91648 is a reply to message #91646] Fri, 27 December 2002 07:11 Go to previous message
Mahesh Rajendran
Messages: 10694
Registered: March 2002
Location: oracleDocoVille
Senior Member
Account Moderator
'/temp' is the convention used in UNIX.
i beleive you have to use something like
'c:temp' 

Previous Topic: Problem in calling java stored proc from pl/sql
Next Topic: BC4J setup in Jdeveloper
Goto Forum:
  


Current Time: Tue Jul 27 16:50:34 CDT 2021