Servlets java.io.FileNotFoundException?

Servlets java.io.FileNotFoundException?,servlets,Servlets,我已经编写了jsp、servlet的代码,用于将文档文件上传到数据库中 这是我的代码,但我得到的错误如下==java.io.FileNotFoundException:插入到恢复(resume)值(?)(文件名、目录名或卷标语法不正确)。请帮助我如何删除此错误 try { Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance(); con=DriverManager

我已经编写了jsp、servlet的代码,用于将文档文件上传到数据库中

这是我的代码,但我得到的错误如下==java.io.FileNotFoundException:插入到恢复(resume)值(?)(文件名、目录名或卷标语法不正确)。请帮助我如何删除此错误

           try
    {   

    Class.forName("net.sourceforge.jtds.jdbc.Driver").newInstance();
        con=DriverManager.getConnection("jdbc:jtds:sqlserver://W2K8SERVER:1433/career","sa","Alpha#123" );

        pst = con.prepareStatement("select * from data1 where email=? and password=?");   


        pst = con.prepareStatement
        ("insert into resume(resume) "+ "values(?)");

        File re = new File("" + pst);
        fis = new FileInputStream(re);
        pst.setBinaryStream(3, (InputStream)fis, (int)(re.length()));
        pst.setString (1,upload);


        //rs = pst.executeQuery();


        while (rs.next())
            cnt ++;

        int s = pst.executeUpdate();
        if(s>0) {
          System.out.println("Uploaded successfully !");
         }
        else {
        System.out.println("unsucessfull to upload image.");
          }
                    rs.close();
        pst.close();   
        con.close();
        }   

这是因为
insert-into-resume(resume)值(?)
可能不是磁盘上的文件名

  pst = con.prepareStatement ("insert into resume(resume) "+ "values(?)");
  File re = new File("" + pst);
您正在从
“”+pst
创建
文件,这是对
PreparedStatement
调用
toString()
的结果。您是否加入了
以消除信息性编译错误

您可能在其他变量中有真实的文件名

 File re = new File(theRealFileNameVariable);

请确保“pst”值是有效的文件路径,显然值“插入到恢复(恢复)值(?)”不是有效的文件路径java.io.file类有四(4)个构造函数

File(File parent, String child)
File(String pathname)
File(String parent, String child)
File(URI uri)
在本例中,您试图向构造函数传递一个对象或类型
java.sql.PreparedStatement
,您试图将其转换为字符串。我不知道pst将如何引用文件的路径(即使您将pst转换为字符串)。请返回并阅读一些关于java.io的内容

可能重复的
File(File parent, String child)
File(String pathname)
File(String parent, String child)
File(URI uri)