Hi All,
I have created below java source and compile, I am getting "Java Created with compilation errors"
I have given JAVAUSERPRIV to my user.
Pls help to resolve this issue. thanks
CREATE OR REPLACE AND COMPILE 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)};
}
}
}
/
Warning: Java created with compilation errors.
SQL> show errors
Errors for JAVA SOURCE "DirList":
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 DirList:5: cannot find symbol
0/0 4 errors
0/0 location: class DirList
0/0 public static void GetList(String directory) throws SQLException
0/0 ^
0/0 DirList:7: cannot find symbol
0/0 symbol : class File
0/0 location: class DirList
0/0 File path = new File( directory );
0/0 ^
0/0 DirList:7: cannot find symbol
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 symbol : class File
0/0 location: class DirList
0/0 File path = new File( directory );
0/0 ^
0/0 DirList:10: cannot find symbol
0/0 symbol : variable Length
0/0 location: class java.lang.String[]
0/0 for(int i=0; i<List.Length; i++)
0/0 ^
0/0 symbol : class SQLException
SQL> alter java class "DirList" compile;
Warning: Java altered with compilation errors.
SQL> alter java class "DirList" compile;
Warning: Java altered with compilation errors.
SQL> show errors
Errors for JAVA CLASS "DirList":
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 ORA-29535: source requires recompilation
SQL> alter java class "DirList" compile;
Warning: Java altered with compilation errors.
SQL> show errors
Errors for JAVA CLASS "DirList":
LINE/COL ERROR
-------- -----------------------------------------------------------------
0/0 ORA-29535: source requires recompilation