I want to dynamically set the table name in the select Ibatis tag.
<select id="queryGetTopSongCount" parameterClass="java.lang.String" resultClass="java.lang.Integer">
SELECT
count(0)
FROM
#toptable#
</select>
The GetTopSongCount request is called below.
Map<String, Object> parameterMap = new HashMap<String, Object>();
parameterMap.put("toptable", "top_of_week_tab_6_2014");
int totalPagination=(Integer)getMainSqlMapClient().queryForObject(queryGetTopSongCount, toptable);
I get the following error
com.ibatis.common.jdbc.exception.NestedSQLException:
The problem is with double quotes. How can we set the string parameter without double quotes?
source
share