代码

List rows = jdbcTemplate.queryForList("SELECT * FROM USER");

Iterator it = rows.iterator();

while(it.hasNext()) {

Map userMap = (Map) it.next();

System.out.print(userMap.get("user_id") + "\t");

System.out.print(userMap.get("name") + "\t");

System.out.print(userMap.get("sex") + "\t");

System.out.println(userMap.get("age") + "\t");

}

发表回复