*例外 : *
java.sql.SQLException: [Microsoft][ODBC Microsoft Access Driver] Syntax error in UPDATE statement
代码是:
String Name = txtName.getText();`
String Email = txtEmail.getText();
String Mobile = txtMobile.getText();
String Address = txtAddress.getText();
String Dob = txtDob.getText();
尝试 {
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
connection = DriverManager.getConnection("jdbc:odbc:NewPData");
String query = "update Table1 set Name='" + Name + "' , Email='" + Email + "' , Mobile=" + Mobile + ", Address= '" + Address
+ "', DOB=" +Dob + ", 其中 ID=" + 更新; PreparedStatement ps_Statement = connection.prepareStatement(query); ps_Statement.executeUpdate(); JOptionPane.showMessageDialog(panelID, "记录更新成功"); 连接.close(); } 捕捉 (ClassNotFoundException e) { e.printStackTrace(); } catch (SQLException e) { e.printStackTrace(); }