1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| try{
Statement req = con.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE, ResultSet.CONCUR_UPDATABLE);
ResultSet result = req.executeQuery("INSERT INTO T_Voyages " + "(NoVoyage,LibVoyage, DateDebut, Duree, NbInscrits, NoDestination) " + "VALUES "+"(" + pNoVoyage + "," + "'" + pLibVoyage + "'," + "'" + pDateDebut + "'," + "" + pDuree + "," + "" + pNbIns + "," + "" + pNoDestination + ")");
result.afterLast();
result.moveToInsertRow();
result.updateInt("NoVoyage", pNoVoyage);
result.updateString("LibVoyage",pLibVoyage);
result.updateString("DateDebut",pDateDebut);
result.updateInt("Duree",pDuree);
result.updateInt("NbInscrits",pNbIns);
result.updateInt("NoDestination",pNoDestination);
result.insertRow();
result.first();
}
catch(Exception e) {
System.out.println("L'erreur :" +e);}
} |
Partager