@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"; }
private int getColumnCount(DatabaseManager manager, String tableName) throws Exception { return Integer.parseInt(manager.find(tableName).get(0)); }