-- alert_log_dirlist.sql -- create the java stored procedure -- that lists the directories of a given -- directory 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, String oracleDirName) throws SQLException { File path = new File( directory ); String[] fileList = path.list(); String fileName; long fileSize; long fileDate; for(int i = 0; i < fileList.length; i++) { fileName = fileList[i]; File lfile = new File(directory + '/' + fileName ); fileSize = lfile.length(); fileDate = lfile.lastModified(); // just look at trace files if ( fileName.endsWith(".trc") || fileName.endsWith(".TRC") ) { #sql { delete from dirlist where directoryname = :oracleDirName and filename = :fileName }; #sql { insert into dirlist (directoryname, filename,filesize,filedate) values (:oracleDirName, :fileName, :fileSize , to_date('01/01/1970','mm/dd/yyyy') + :fileDate / ( 24*60*60*1000) ) }; } } } } / show errors java source DirList