Connexion2 con = new Connexion2(); con.connectdb(); if(con.connect!=null){ try{ String ins=" insert into employe values ('0', '"+matricule.getText()+"','"+tache.getText()+"')" pst=con.connect.prepareStatement(ins); pst.executeUpdate(); }catch (Exception e){ JOptionPane.showMessageDialog(this, e.getMessage()); }
Connexion2 con = new Connexion2(); con.connectdb(); if(con.connect!=null){ try{ String ins=" insert into employe values ('0', '"+matricule.getText().replaceAll("'", "\\'")+"','"+tache.getText().replaceAll("'", "\\'")+"')" pst=con.connect.prepareStatement(ins); pst.executeUpdate(); }catch (Exception e){ JOptionPane.showMessageDialog(this, e.getMessage());