Instead of going through stored procedure way , table valued functions should have called directly the way we call a query.
I figured out this way:
String sql = "select* from cdc.fn_cdc_get_all_changes_" + tableName + "(:from_lsn , :tos_lsn , :row_filter_option)";
MapSqlParameterSource params = new MapSqlParameterSource();
params.addValue("from_lsn" , lsn1);
params.addValue("tos_lsn", lsn2);
params.addValue("row_filter_option", "all");
List<Student>s = namedParameterJdbcTemplate.query(sql, params, new RowMapper<Student>()
{
@Override
public Student mapRow(ResultSet rs, int rowNo) throws SQLException
{
Student s = new Student();
s.setId(rs.getInt(5));
s.setName(rs.getString(6));
s.setAge(rs.getInt(7));
return s;
}
});
return s;