Ejemplo n.º 1
0
  @RequestMapping(
      value = "/find",
      params = {"tableName"},
      method = RequestMethod.POST)
  public String finding(
      Model model, @RequestParam(value = "tableName") String tableName, HttpSession session) {
    DatabaseManager manager = getManager(session);

    List<String> tableData = null;
    try {
      tableData = manager.find(tableName);
    } catch (SQLException e) {
      e.printStackTrace();
      return "error";
    }
    model.addAttribute("table", getLists(tableData));
    return "find";
  }
Ejemplo n.º 2
0
 private int getColumnCount(DatabaseManager manager, String tableName) throws Exception {
   return Integer.parseInt(manager.find(tableName).get(0));
 }