Ich habe vor kurzem einen Fehler in meiner SQL-Syntax und ich kann nicht herausfinden, was das Problem ist.JavaFX SQL Syntax Fehler
String table = "rfc";
String update = "UPDATE "+table+" set Type = '" + AWBTypeBox.getValue() + "' set Aantal = " + AWBAantal.getText() + " set Gewicht = " + AWBGewicht.getText() + " set Volume = " + AWBVolume.getText() + " set Beschadiging = '" + AWBBeschadiging.getText() + "' where idReservering = " + account_id + "";
Statement statement = dbCon.conDatabase().createStatement();
int resultSet = statement.executeUpdate(update);
Der Fehler es gibt, ist:
SEVERE: null
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 'set Aantal = 2 set Gewicht = 20 set Volume = 15 set Beschadiging = 'ja' where id' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
Ich versuchte, 1 Stunde versucht, die Dinge in der Syntax aber nichts, um den Fehler behoben zu ändern.
Bitte schauen Sie sich die [Syntax von 'UPDATE' in der MySQL-Dokumentation] an (https://dev.mysql.com/doc/refman/5.7/de/update.html). Es hat nur eine einzige set-Klausel, und die Zuweisungen sind durch Kommata getrennt. –