这是在岛上,就像这样:
public List<Tables> getTablesList(){
List<Tables> list=jdbcTemplate.query(Queries.GET_USER_DATATABLES,new RowMapper<Tables>(){
`like so`
@Override
public Tables mapRow(ResultSet rs, int rowNum) throws SQLException {
// TODO Auto-generated method stub
Tables table=new Tables();
while(rs.next()) {
table.setTables_in_mydb(rs.getString("Tables_in_mydb"));
System.out.println("Hi"+table.toString());
}
return table;
}
});
return list;
}
这在控制器中:
@RequestMapping(value = "/list")
public String getuser(Model model){
List<Tables> user=userdao.getTablesList();
model.addAttribute("list",user);
return "get-user-table";
}