1
You can return the function as ResultSet instead : public ResultSet getEntry(String table, String[] ident){ try{ stmt = conn.createStatement(); String exec = "SELECT " + ident[0] + " FROM " + table; if(!ident[1].isEmpty()){ exec += " WHERE(" + ident[1] + ");";...