开发者

How to use the SimpleJdbcTemplate queryForMap

Is there a way to get a Map<String,Integer> for instance? The call seems to return only a Map<String, Object> which I can't开发者_JAVA技巧 cast to Map<String,Integer>.


I usually use it like this:

Map result = simpleJdbcTemplate.queryForMap(
 "SELECT COUNT(*) AS intRecords " +
 "FROM tblUsers",
 new Object[]);

Integer users = result.get("intRecords");

Does that help you?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜