1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
|
String requete = "UPDATE APPLICATION.GARANTIE set DOCUMENT = ?, NOMFICHIER = ?, DATE_INSERTION = ? where ID = ? ";
stmt = conn.prepareStatement(requete);
try{
String[] tab_idGaranties = idsGarantie.split("_");
for(int i=0;i<tab_idGaranties.length;i++){
stmt.setBinaryStream(1, fis, tailleFichier );
stmt.setString(2, nomFichier);
stmt.setTimestamp(3, new Timestamp(Calendar.getInstance().getTimeInMillis()));
stmt.setLong(4, new Long(tab_idGaranties[i]).longValue());
stmt.executeUpdate();
}
conn.commit();
stmt.clearParameters();
}
catch(Exception e){
System.out.println(e);
}
finally{
stmt.close();
conn.close();
} |
Partager