我已经编写了jsp,servlet的代码,用于在数据库中上传Doc文件。插入恢复(恢复)值(?)(文件名,目录名称或卷标语法不正确)。这里是我的代码,但我得到这样的错误== java.io.FileNotFoundException:插入恢复(继续)值(?)(文件名,目录名称或卷标语法不正确)。请帮助我如何删除此错误?java.io.FileNotFoundException?
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();
}
[Servlet将文本或文档文件发送到SQL Server 2008]的可能的重复(http://stackoverflow.com/questions/5336295/servlet-for-sending-the-text-or-document-file-到了-SQL服务器2008年) – BalusC 2011-03-17 13:12:47