私はいくつかのjspファイルを持っています。それにはいくつかの変数があります。次のように、これらの変数を mysql クエリ内で使用したいと考えています。
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+"'");
次の例外が発生しました:
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''