2013年10月11日星期五

SPRINGMVC unable to obtain query results

Using a
jdbcTemplate.query (sql, rm);
Get Data
rm is a realization of the RowMapper interface.

public PhoneCountVO mapRow (ResultSet rs, int num) throws SQLException
{
PhoneCountVO entity = new PhoneCountVO ();
entity.setCount (rs.getInt ("count"));
entity.setTitle (rs.getString ("title"));
entity.setCityId (rs.getInt ("city_id"));
return entity;
}

passed into an SQL query directly in the database without a problem , but after calling the method can not return data.
------ Solution ---------------------------------------- ----
List list = jdbcTemplate.query (sql, rm);
------ For reference only ----------- ----------------------------
find the database even wrong. . .

scores still gave it. Or wasted

没有评论:

发表评论