我正在尝试从文件中获取上次修改日期,并且收到以下错误消息
ORA-29531: no method getLastModDate in class CheckFile
ORA-06512: at "ITIS_SERVICE.GETLASTMODIFIED", line 1
ORA-06512: at line 5
这是我的代码
CREATE OR REPLACE AND COMPILE JAVA SOURCE NAMED CheckFile AUTHID DEFINER
AS
import java.io.*;
import java.util.Date;
public class CheckFile {
public static Date getLastModDate (String filename) {
File file = new File(filename);
Date dm = new Date (file.lastModified());
return dm;
}
}
这里我正在发布Java类
CREATE OR REPLACE FUNCTION GetLastModified (pfilename IN VARCHAR2)
RETURN Date AUTHID DEFINER
AS LANGUAGE JAVA
NAME 'CheckFile.getLastModDate(String) return Date';
我在这里调用函数
declare
vDate Date;
begin
vDate := GETLASTMODIFIED('\\itisapp1\import\ftptest\in\212_2011_08_04_FID24067641.avr.dec');
DBMS_OUTPUT.PUT_LINE('A '||vDate);
end;
任何帮助将不胜感激