0

i'm using spring boot, i want to add new "champ", this is the code

                Champ c  = new Champ();
                c.setOrder(1);
                c.setType("RRRR");
                c.setStructurenotification("#AA");
                champservice.AddNewChamp(c);

the table "champ" have fields : "idchamp", "structidstructurenotification" ,"type" and "order".

but i get this error

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 'order, 
structidstructurenotification, type, idchamp)
 values (1, '#AA', 'RRRR', 0' at line 1
software
  • 21
  • 6
  • i think its because of the "order" it Ordery is a keyword for Order By..change the column name and try – Sachu May 24 '15 at 11:50

1 Answers1

3

Order is a reserve word for Order By. Change the column name to some meaningful name and check.

Sachu
  • 7,555
  • 7
  • 55
  • 94