![](/img/trans.png)
[英]SQL statement is not executed! java.sql.SQLException: General error
[英]java.sql.SQLException:General error
我正在獲取java.sql.SQLException: General error
我正在嘗試從Access數據庫刪除數據,但會引發該錯誤。 嘗試{
conn = DBConnection.DBConnector();
pst = conn.prepareStatement("DELETE FROM Table1 where (name, level, study, 1pn, 2pn, 1pk, 2pk, summ, teori, p-d, ind, gat, pav) values (?,?,?,?,?,?,?,?,?,?,?,?,?)");
pst.setString(1, (String) dsr[0]);
pst.setString(2, (String) dsr[1]);
pst.setString(3, (String) dsr[2]);
pst.setDouble(4, (double) dsr[3]);
pst.setDouble(5, (double) dsr[4]);
pst.setDouble(6, (double) dsr[5]);
pst.setDouble(7, (double) dsr[6]);
pst.setDouble(8, (double) dsr[7]);
pst.setDouble(9, (double) dsr[8]);
pst.setDouble(10, (double) dsr[9]);
pst.setDouble(11, (double) dsr[10]);
pst.setDouble(12, (double) dsr[11]);
pst.setDouble(13, (double) dsr[12]);
pst.executeUpdate();
pst.close();
JOptionPane.showMessageDialog(null, "Data delited!");
}catch(Exception e){
throw new RuntimeException(e);
}
來自數據庫的數據完美地插入到JTable中,我讓JOptionPane.showMessageDialogs檢查數組是否不為null,但是數組填充了白色值。
我嘗試刪除一個值,但仍然收到相同的錯誤...
Exception in thread "AWT-EventQueue-0" java.lang.RuntimeException: java.sql.SQLException: General error
Caused by: java.sql.SQLException: General error
at sun.jdbc.odbc.JdbcOdbc.createSQLException(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.standardError(Unknown Source)
at sun.jdbc.odbc.JdbcOdbc.SQLExecute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.execute(Unknown Source)
at sun.jdbc.odbc.JdbcOdbcPreparedStatement.executeQuery(Unknown Source)
at Main$ButtonEditor.getCellEditorValue(Main.java:442)
使用executeUpdate
進行數據庫寫操作
pst.executeUpdate();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.