我想知道这个陈述是否正确,因为当我运行它时没有做出任何改变。
这里是代码:
String name= request.getParameter("eid");
String newname = request.getParameter("categoryName");
String newimage = request.getParameter("ImagePath");
File imgfile = new File(newimage);
FileInputStream fin = new FileInputStream(imgfile);
PreparedStatement pre = conn.prepareStatement
("Update category set category_name=?, category_image = ? where category_name =?");
pre.setString(1, newname);
pre.setBinaryStream(2,fin,(int)imgfile.length());
pre.setString(3, name);
pre.executeUpdate();
pre.close();
conn.close();
}
catch (Exception e)
{
e.printStackTrace();
}