public boolean setPhotoByXDNL(String idvalue,String path1,String path2,String path3,String path4)throws Exception{
boolean flag = false;
File file1 = new File(path1);
InputStream input1 = new FileInputStream(file1);
File file2 = new File(path2);
InputStream input2 = new FileInputStream(file2);
File file3 = new File(path1);
InputStream input3 = new FileInputStream(file3);
File file4 = new File(path1);
InputStream input4 = new FileInputStream(file4);
Connection conn = MyCon.getCon();
PreparedStatement pstm = conn.prepareStatement("UPDATE SHOW.DEPT_INFO SET PICTURE1=? , PICTURE2=? , PICTURE3=? , PHOTO=? WHERE ID=?");
pstm.setBinaryStream(1, input1,input1.available());
pstm.setBinaryStream(2, input2,input2.available());
pstm.setBinaryStream(3, input3,input3.available());
pstm.setBinaryStream(4, input4,input4.available());
pstm.setInt(5, idvalue);
int count = pstm.executeUpdate();
if(count>0){
flag = true;
System.out.println("--------------成功更新图片!");
}
return flag;
}代码如上,参数idvalue为主键值,后面四个分别为图片的路径我要怎么才能将四个图片同时插入到数据库中去呢我试过这样只能插入一张图片,多张就会报错,为什么呢?有哪位大虾能帮帮我呢在线等,急,小弟先在这里谢了