public void insert(String tabName, ArrayList arguments) {
        connect();
        if(msg.equals("OK")) {
            ShowTableBean stb = new ShowTableBean();
            int size = arguments.size() * 2;
            stb.connect();
            ArrayList fields = stb.getAttributies(tabName, "Field");
            //ArrayList types = stb.getAttributies(tabName, "Type");
            stb.close();

            String statement = "INSERT INTO " + tabName + "(";
            for(int i = 0; i < size; i++) {
                if(i < size/2-1) {
                    statement = statement.concat(fields.get(i) + ",");
                } else if((i + 1)*2 == size) {
                    statement = statement.concat(fields.get(i) + ") VALUES(");
                } else if(i + 1 == size) {
                    statement = statement.concat("?);");
                } else {
                    statement = statement.concat("?,");
                }
            }
            try {
                PreparedStatement ps = con.prepareStatement(statement);
                int position = 0;

                Iterator itr = arguments.iterator();
                while(itr.hasNext())
                {
                    position++;
                    String argument = itr.next().toString();
                    try {
                         ps.setInt(position, Integer.parseInt(argument));
                    } catch(Exception e) {
                         ps.setString(position, argument);
                    }
                }
                ps.executeUpdate();
                fireResult("Záznam byl vložen");
            } catch (SQLException e) {
                fireResult(e.getMessage());
            }
        } else {
            fireResult("No connection");
        }
        close();
    }