我有半小时的作业提交,我迫切需要帮助。提前感谢所有支持。
我的代码是
String query= "INSERT INTO `chemistry`(Question, Answer, A:, B:, C:, D:) VALUES ('"+jTextField_Question.getText()+"' , '"+jTextField_Answer.getText()+"' , '"+jTextField_A.getText()+"' , '"+jTextField_B.getText()+"', '"+jTextField_C.getText()+"', '"+jTextField_D.getText()+"')" ;
Erro的到来是:
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 ':, B:, C:, D:) VALUES ('ertyjk' , '' , '' , '', '', )' at line 1
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)