String sql = "UPDATE employee SET employeeID=?,EName=?,ESname=?,EAddress=?,ETel=?,ESalary=?,EPosition=?,EBirthday=?,EStartdate=? WHERE employeeID=?";
try{
java.sql.Connection c = db.getConnection();
PreparedStatement pre = c.prepareStatement(sql);
pre.setString(1,txtIDemp.getText());
pre.setString(2,txtName.getText());
pre.setString(3,txtLname.getText());
pre.setString(4,txtaddress.getText());
pre.setString(5,txttel.getText());
pre.setString(6,txtSalary.getText());
pre.setString(7,txtPosition.getText());
pre.setString(8,txtBirth.getText());
pre.setString(9,txtStart.getText());
pre.setString(10,txtIDemp.getText());
ฟ้องเออเร่อ ตอน รันแล้วกดปุ่ม
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,EName=?,ESname=?,EAddress=?,ETel=?,ESalary=?,EPosition=?,EBirthday=?,EStartdat' at line 1 ...
error java gui ช่วยทีค่ะ ไม่รู้มันผิดตรงไหนจริง ๆ
try{
java.sql.Connection c = db.getConnection();
PreparedStatement pre = c.prepareStatement(sql);
pre.setString(1,txtIDemp.getText());
pre.setString(2,txtName.getText());
pre.setString(3,txtLname.getText());
pre.setString(4,txtaddress.getText());
pre.setString(5,txttel.getText());
pre.setString(6,txtSalary.getText());
pre.setString(7,txtPosition.getText());
pre.setString(8,txtBirth.getText());
pre.setString(9,txtStart.getText());
pre.setString(10,txtIDemp.getText());
ฟ้องเออเร่อ ตอน รันแล้วกดปุ่ม
com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '?,EName=?,ESname=?,EAddress=?,ETel=?,ESalary=?,EPosition=?,EBirthday=?,EStartdat' at line 1 ...