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[] fileList=path.list(); String fileName; String filepath; long fileSize; long fileDate; for (int i=0;i<fileList.length; i++) { fileName=fileList[i]; File fpath=new File(directory+'/'+fileName); filepath=directory; fileSize=fpath.length(); fileDate=fpath.lastModified(); #sql{insert into dirlist(filepath,filename, filesize, filedate) values(:filepath,:fileName,:fileSize,to_date('01/01/1970','mm/dd/yyyy')+:fileDate/(24*60*60*1000))}; } } } -----create procedure to call java source for getting files / CREATE OR REPLACE PROCEDURE p_get_dir_list(i_directory IN VARCHAR2) AS LANGUAGE JAVA NAME 'DirList.getList(java.lang.String)'; / --------------------- call p_get_dir_list('F:/Xunlei/200711/SS');