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
| try{
//--Insructions de connection
String url ="jdbc:odbc:toto";
String luser = "user1";
String passe = "password";
con=DriverManager.getConnection(url,luser,passe);
proc = "{call pro_etudiant(?)}";
cbst = con.prepareCall(proc);
try{
cbst.setString(1,"Une chaine de caractère");
cbst.execute();
out.println("Insertion reussite");
}
catch(Exception e){
out.println("Insertion echouee" + e.getMessage());
}
cbst.close();
con.close();
con =null;
cbst=null;
}// ---try
catch(Exception e){
out.println("Echec de connexion" + e.getMessage());
} //---catch |
Partager