1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Connection Con;
String Drv="oracle.jdbc.driver.OracleDriver";
String Url="jdbc:oracle:oci8:@stage";
try
{
Class.forName(Drv).newInstance();
Con=DriverManager.getConnection(Url,"system","manager");
Statement Stmt=Con.createStatement();
String SQL="INSERT INTO TypeEquipement (Code_Typ_Equip, Libelle_Typ_Equip) VALUES(12,FOURNITURE)";
Stmt.execute(SQL);
Con.close();
}
catch(Exception e){ System.out.println("base introuvabe");}
} |
Partager