i have some jsp file. it has some variables. i want to use these varibles inside a mysql query as follows.
String given_session="monsoon";
String given_year="2012";
// note above two will be dynamically added.
ResultSet rs11 = (ResultSet) st11.executeQuery("show tables like '%_Assessment_" + given_session + "_" + given_year+"'");
I got the following exception :
java.sql.SQLException: 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 '%_Assessment_Monsoon_2013''