I got a Sql syntax errorcom.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 '8 , 0' at line 1,(i take attribute by input),my table in mysql is,for example i post an insert:
INSERT INTO itshop.supply (id, idSupplier, dateTime, quantity, totalCost) VALUES ('2', '4', '2009-1-4', '24', '245');
int rs2 = st2.executeUpdate("INSERT INTO supply VALUES ( "
+ id + " , " + idSupplier + " , "
+ dateTime + " , " + idProduct + " ,"
+ Quantity + " , " + price + "");
if (rs2 == 1) {
JOptionPane.showMessageDialog(Sale,
"Product Ordered", "Supply",
JOptionPane.DEFAULT_OPTION);
}
)in SQL query.