Insert avec comboBox et JDateChooser ne marche pas (Java, SQL)
Bonsoir a tous,
J'ai un projet d’études de gestion de paiement... Bon j'ai un problem c'est que l'insertion ne marche pas et je ne sais pas pourquoi.
voila le code d'ajout :
Code:
1 2 3 4 5 6 7 8 9 10 11 12
| try{
pst=con.prepareStatement("insert into paiement(NUMAPP ,NUMRECUE ,MODEP ,NUMP ,MOISP ,DATEP ) values(?,?,?,?,?,?)");
pst.setString(1, appField.getText());
pst.setString(2, recueField.getText());
pst.setString(3, mode.getSelectedItem().toString()); / ComboBox
pst.setString(4, NpaiemantField.getText());
pst.setString(5, ((JTextField)moisChooser.getDateEditor().getUiComponent()).getText()); // JDateChooser
pst.setString(6, ((JTextField)ddpChooser.getDateEditor().getUiComponent()).getText()); // JDateChooser
pst.execute();
JOptionPane.showMessageDialog(null, "paiement réussi");
}catch(SQLException | HeadlessException e){JOptionPane.showMessageDialog(null, "Erreur paiement ");} |
Je travail avec sql (oracle) et voila la table paiement :
Citation:
Nom NULL ? Type
----------------------------------------- -------- ----------------------------
NUMAPP NOT NULL NUMBER(4)
NUMRECUE NOT NULL NUMBER(10)
MODEP NOT NULL VARCHAR2(15)
NUMP NUMBER(30)
MOISP NOT NULL DATE
DATEP NOT NULL DATE
Merci d'avance :) ;