public void update(String tabName, String value, String column, ArrayList<String> values,
            ArrayList<String> names){
        String statement = "UPDATE " + tabName + " SET " + column + "=? WHERE ";
        connect();
        if(msg.equals("OK")) {
            for(int i = 0; i < names.size(); i++) {
                if(i + 1 == values.size()) {
                    statement = statement.concat(names.get(i)+"=?");
                } else {
                    statement = statement.concat(names.get(i)+"=? && ");
                }
            }
            try{
                PreparedStatement ps = con.prepareCall(statement);
                try {
                        ps.setInt(1, Integer.parseInt(value));
                    } catch (Exception e) {
                        ps.setString(1, value);
                    }
                for(int i = 0; i < values.size(); i++) {
                    try {
                        ps.setInt(i + 2, Integer.parseInt(values.get(i)));
                    } catch (Exception e) {
                        ps.setString(i + 2, values.get(i));
                    }
                }
                ps.executeUpdate();
                fireResult("Záznam byl změněn");
            } catch (SQLException e) {
                fireResult(e.getMessage());
            }
        } else {
            fireResult("No connection");
        }
        close();
    }