I am trying to run the following statement in a java program.My problem is the first question mark(parameter) in the statement is failing and the error message reads :
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 ''hello' ON SCHEDULE EVERY 1 WEEK STARTS CONCAT(CURRENT_DATE + INTERVAL 1 - WEEKD' at line 1.
Is there something im missing can i not carry out a statement in this fashion ? The query worked before i tried to add the first parameter and just added a name manually into the query ,Any help will of course be appreciated.
PreparedStatement ps1 = null;
ps1 = connection.prepareStatement("CREATE EVENT ? ON SCHEDULE EVERY 1 WEEK STARTS CONCAT(CURRENT_DATE + INTERVAL ? - WEEKDAY(CURRENT_DATE) DAY, ? ) "
+ " DO UPDATE tablename SET status = ? WHERE name= ? AND address= ?");