-1

Below code is working properly in eclipse. But I,m trying to create this source in oracle 11g Db. While creating it throws some warnings.

create or replace
and compile java source named "Noitime"
as
package com;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.attribute.FileTime;

public class Noitime {
public String attr(String filepath,String filename)
{
long time = System.currentTimeMillis();
FileTime fileTime = FileTime.fromMillis(time);
Path path = Paths.get(filepath,filename);

try {
Files.setLastModifiedTime(path, fileTime);
return "Success";
} catch (IOException e) {
System.err.println(e);

return "Fail";
}
}
}
Jon Heller
  • 34,999
  • 6
  • 74
  • 132

1 Answers1

1

You appear to have garbled the error/warning message, but I think that it is telling you that you should be using the pathname "com/Noitime.java" when compiling. The pathname you use should correspond to the full class name, and the full class name is "com.Noitime".

Stephen C
  • 698,415
  • 94
  • 811
  • 1,216