je tente d'ajouter un bouton d'enregistrement et il me donne cette erreur dans la console EclipseConserver la fiche et de montrer dans le tableau
java.sql.SQLException: Column count doesn't match value count at row 1 at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1073) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3597) at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3529) at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1990) at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2151) at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2619) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1698) at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1617) at LOTest$2.actionPerformed(LOTest.java:73) at javax.swing.AbstractButton.fireActionPerformed(Unknown Source) at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source) at javax.swing.DefaultButtonModel.setPressed(Unknown Source) at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source) at java.awt.Component.processMouseEvent(Unknown Source) at javax.swing.JComponent.processMouseEvent(Unknown Source) at java.awt.Component.processEvent(Unknown Source) at java.awt.Container.processEvent(Unknown Source) at java.awt.Component.dispatchEventImpl(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source) at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source) at java.awt.Container.dispatchEventImpl(Unknown Source) at java.awt.Window.dispatchEventImpl(Unknown Source) at java.awt.Component.dispatchEvent(Unknown Source) at java.awt.EventQueue.dispatchEvent(Unknown Source) at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source) at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.pumpEvents(Unknown Source) at java.awt.EventDispatchThread.run(Unknown Source)
btnUpdateS.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent msUpdate) {
try {
qstm.qDB.executeUpdate("insert into matsub (matsubid, matsubname) values
('"+ txMatSID.getText() + "' + ',' + '" + txMatSName.getText() + "');");
getContentPane().add(scrollPane);
MatSTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
MatSTable.setFillsViewportHeight(true);
getContentPane().repaint();
} catch (SQLException e) {
// TODO Auto-generated catch block
e.printStackTrace();
Je vous en serais reconnaissant s'il y a quelqu'un qui peut partager la lumière sur ce problème , Je suis moi-même assez nouveau dans ce java.
Ce poste est à moi: [www.java-forums.org: jtable-repaint] (http://www.java-forums.org/awt-swing/46305-jtable-repaint.html) –
qui est après que j'ai découvert le problème que j'ai posté ici à propos de l'erreur "java.sql.SQLException: nombre de colonnes ne correspond pas au nombre de valeur à la ligne 1" dans lequel après avoir résolu le sql j'ai trouvé la méthode repaint ne fonctionne pas attendu, maintenant tout fonctionne bien, merci – Levian