我已經編寫了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