Search in sources :

Example 1 with MultiDBQueryComposite

use of com.cubrid.common.ui.query.control.MultiDBQueryComposite in project cubrid-manager by CUBRID.

the class QueryEditorPart method runMultiQuery.

public void runMultiQuery() {
    String queries = combinedQueryComposite.getSqlEditorComp().getSelectedQueries();
    MultiDBQueryComposite multiDbQueryComposite = combinedQueryComposite.getMultiDBQueryComp();
    List<CubridDatabase> queryDatabaseList = multiDbQueryComposite.getQueryDatabaseList();
    combinedQueryComposite.getResultTabFolder().setSelection(3);
    int selectedDatabases = queryDatabaseList.size();
    Vector<String> queryVector = QueryUtil.queriesToQuery(queries);
    int countOfQueries = queryVector.size();
    // [TOOLS-2425]Support shard broker
    if (selectedDatabases < 2) {
        if (countOfQueries < 2) {
            if (selectedDatabases == 1 && queryDatabaseList.get(0).getDatabaseInfo().isShard()) {
                runMultiShardQuery(queries);
            } else {
                showToolTip(multiDbQueryComposite, multiDbQueryComposite.getRunItem(), Messages.ttMultiQueryTitle, Messages.qedit_multiDBQueryComp_run_err);
            }
        } else {
            // one database multiple SQL query
            runMultiSQLQuery(queries);
        }
    } else {
        runMultiDBQuery(queries, queryDatabaseList);
    }
}
Also used : MultiDBQueryComposite(com.cubrid.common.ui.query.control.MultiDBQueryComposite) CubridDatabase(com.cubrid.common.ui.spi.model.CubridDatabase) Point(org.eclipse.swt.graphics.Point)

Aggregations

MultiDBQueryComposite (com.cubrid.common.ui.query.control.MultiDBQueryComposite)1 CubridDatabase (com.cubrid.common.ui.spi.model.CubridDatabase)1 Point (org.eclipse.swt.graphics.Point)1