private void doQuery(boolean doMulti) {
        dbDef = (DbDefinition) serverListCB.getSelectedItem();
        if (dbDef == null) {
            JOptionPane.showMessageDialog(this, "No database server defined", "",
                    JOptionPane.WARNING_MESSAGE);
        }
        else {
            messageArea.setText("");
            String sqlDelim = SqlToolkit.userConfig.getSqlDelim();
            //			String bodyDelim = SqlToolkit.userConfig.getBodyDelim();
            String query = queryEditor.getSelectedText();

            // If there is selected text, run only that portion of the query; if we aren't
            // doing multiple queries, ignore the delimiter ...
            if (query == null || query.length() < 4) {
                query = sqlDoc.getQueryAtIndex(queryEditor.getCaretPosition(), sqlDelim);
            } else if (! doMulti) {
                sqlDelim = null;
            }

            if (query == null  ||  query.trim().length() < 4) {
                messageArea.setText("Please select query to execute, or put cursor in query ...");
                tabbedPane.setSelectedComponent(messagePane);
                redBtnPush(false);
                return;
            }

            if (!queryHistory.contains(query)) {
                queryHistory.add(query);
                currentQuery = queryHistory.size() - 1;
                enableHistoryButtons();
            }

            // Print out an appropriate message if the connection is bad
            Connection conn = ConnectionManager.GetConnection(dbDef, true);
            if (conn == null) {
                messageArea.setText(ConnectionManager.GetConnectionError(dbDef));
                tabbedPane.setSelectedComponent(messagePane);
                redBtnPush(false);
                return;
            }

            // Have the "factory" kick off the retrieval process
            resultTableModel = sqlModelFactory.createModelData(conn, query, sqlDelim, doMulti);
            resultTable.setModel(resultTableModel);
            if (isQueryResultsSplit) {
                tabbedPane.setSelectedComponent(resultPane);
            } else {
                tabbedPane.setSelectedComponent(querySplitPane);
            }

            monitorQuery();
        }
    }