Java error [message #91646] |
Thu, 26 December 2002 11:14 |
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 |
|
Mahesh Rajendran
Messages: 10708 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'
|
|
|