顯示我嘗試添加一個保存按鈕,這讓我在Eclipse控制檯此錯誤保存記錄,並在表
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();
,如果有任何人誰能夠在這個問題上共享光明,我會很感激,我自己在這個java中是相當新的。
相關的帖子在這裏:[www.java-forums.org:JTable中-重繪(http://www.java-forums.org/awt-swing/46305-jtable-repaint.html) –
那個帖子是我這是後我發現我在這裏發佈有關錯誤「java.sql.SQLException:列數不匹配在第1行的值計數」錯誤的問題,其中我修復了SQL後,我發現重繪方法不工作預計,現在所有的工作正常,但是,謝謝 – Levian