'Post_held="+post_held+"'where
should be
Post_held='"+post_held+"' where
.
On a different note: DO NOT build a SQL statement using string concatenation like that, or you leave yourself open to SQL Injection attacks, which will allow attackers to delete/steal all you data.
Use a PreparedStatement
with parameter markers (?
) and set the values on the statement object.
solved com mysql jdbc exceptions jdbc4 mysql syntax error exception