private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed
        DbProfile profile = new DbProfile();
        
        // fill struct
        if (aliasBox.getText().trim().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Please set the alias field.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        } else {
            profile.setAlias(aliasBox.getText());
        }
        //TODO: check if such alias laready exists
        //TODO: add this profile to profiles list
        
        if (hostName.getText().trim().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Please set the hostname field.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        } else {
            profile.setHostname(hostName.getText());
        }
        
        if (usernameBox.getText().trim().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Please set the username field.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        } else {
            profile.setUsername(usernameBox.getText());
        }
        
        profile.setPassword(passwordBox.getPassword()); // password can be empty
        
        //TODO: use parameter name here
        if (paramBox.getText().trim().isEmpty()) {
            JOptionPane.showMessageDialog(null, "Please set the database field.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        } else {
            profile.setParameter(paramBox.getText());
        }
        
        try {
            profile.setPort(Integer.parseInt(portBox.getText()));
        } catch (NumberFormatException e) {
            JOptionPane.showMessageDialog(null, "Invalid port number.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }

        //TODO: make this configurable from an XML file
        String rdbms = (String)dbList.getSelectedItem();
        profile.setType(rdbms);
        
        if (rdbms.equals("MySQL")) {
            profile.setDriver("com.mysql.jdbc.Driver");
            profile.setConnectionString("jdbc:mysql://<HOST>:<PORT>/<PARAM>");
        } else if (rdbms.equals("Oracle")) {
            profile.setDriver("oracle.jdbc.driver.OracleDriver");
            profile.setConnectionString("jdbc:oracle:thin:@<HOST>:<PORT>:<PARAM>");
        } else {
            JOptionPane.showMessageDialog(null, "Invalid database configuration.", "Error", JOptionPane.ERROR_MESSAGE);
            return;
        }
        
        // last step - init connection
        if (!doConnect(profile)) {
            return;
        }
        
        pro = profile;
        this.setVisible(false);
    }//GEN-LAST:event_okButtonActionPerformed