private void createSteps(Hashtable steps) {
try {
connect = DBUtil.getConnection();
System.out.println(" createSteps called ");
pstmt_step_insert = connect.prepareStatement(createstep);
Iterator iter = steps.keySet().iterator();
System.out.println(" entre avant while create step ");
while (iter.hasNext()) {
System.out.println(" entre dans while create step ");
String stage_code = (String) iter.next();
if(stage_code.endsWith(".00")){
continue;
}
ProjectStep step = (ProjectStep) steps.get(stage_code);
System.out.println(" stage code : "+stage_code);
int id_stage = getIdStageFromMaxima("project_stage");
System.out.println(" createProject ==> id_stage : "+id_stage);
pstmt_step_insert.setString(1, stage_code);
System.out.println(" pdx date test param 1: "+stage_code);
pstmt_step_insert.setString(2, step.getProject_code());
System.out.println(" pdx date test param 2: "+step.getProject_code());
pstmt_step_insert.setString(3, step.getStep_description());
System.out.println(" pdx date test param 3: "+step.getStep_description());
pstmt_step_insert.setDouble(4, step.getBudget());
System.out.println(" pdx date test param 4: "+step.getBudget());
pstmt_step_insert.setDouble(5, step.getAuthorized_spending());
System.out.println(" pdx date test param 5: "+step.getAuthorized_spending());
pstmt_step_insert.setString(6, step.getPdx());
System.out.println(" pdx date test param 6: "+step.getPdx());
pstmt_step_insert.setTimestamp(7, new Timestamp(System.currentTimeMillis()));
//pstmt_step_insert.setTimestamp(7, new Timestamp(new Date().getTime()));
//pstmt_step_insert.setDate(8, step.getCreation_date());
pstmt_step_insert.setTimestamp(8, new Timestamp(System.currentTimeMillis()));
//pstmt_step_insert.setTimestamp(8, new Timestamp(new Date().getTime()));
pstmt_step_insert.setString(9, step.getId_modifier());
System.out.println(" pdx date test param 9: "+step.getId_modifier());
pstmt_step_insert.setString(10, step.getStep_note());
System.out.println(" pdx date test param 10: "+step.getStep_note());
pstmt_step_insert.setDouble(11, step.getProject_forecast());
System.out.println(" pdx date test param 11: "+step.getProject_forecast());
pstmt_step_insert.setDouble(12, step.getProject_forcast_fin_year());
System.out.println(" pdx date test param 12: "+step.getProject_forcast_fin_year());
pstmt_step_insert.setDouble(13, id_stage);
System.out.println(" pdx date test param 13: "+id_stage);
pstmt_step_insert.setDate(14, step.getPdx_date());
System.out.println(" pdx date test param 414: "+step.getPdx_date());
System.out.println(" fibn chargement des param ");
/////////////////
pstmt_step_insert.executeUpdate();
//pstmt_step_insert.executeQuery();
//if(pstmt_step_insert.executeUpdate() != 0)
//{
System.out.println(" statement pas ok : "+pstmt_step_insert);
//}
System.out.println(" fibn chargement des param 2");
connect.commit();
System.out.println(" fibn chargement des param 3");
}
System.out.println(" aprs while create step ");
} catch (Exception e) {
System.out.println(" methode createSteps exception " + e);
}
finally{
try {
pstmt_step_insert.close();
connect.close();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
Partager