Search in sources :

Example 21 with IMetadataConnection

use of org.talend.core.model.metadata.IMetadataConnection in project tdi-studio-se by Talend.

the class ReadQueriesAction method doRun.

@Override
protected void doRun() {
    IStructuredSelection selection = (IStructuredSelection) getSelection();
    IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
    if (repositoryNode == null && selection != null) {
        repositoryNode = (RepositoryNode) selection.getFirstElement();
    }
    DatabaseConnectionItem dbConnectionItem = null;
    ConnectionParameters connParameters = new ConnectionParameters();
    if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
        dbConnectionItem = (DatabaseConnectionItem) repositoryNode.getObject().getProperty().getItem();
        connParameters.setRepositoryName(repositoryNode.getObject().getLabel());
        connParameters.setRepositoryId(repositoryNode.getObject().getId());
        //$NON-NLS-1$
        connParameters.setQuery("");
    } else if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CON_QUERY) {
        QueryRepositoryObject queryRepositoryObject = (QueryRepositoryObject) repositoryNode.getObject();
        dbConnectionItem = (DatabaseConnectionItem) queryRepositoryObject.getProperty().getItem();
        connParameters.setRepositoryName(dbConnectionItem.getProperty().getLabel());
        connParameters.setRepositoryId(dbConnectionItem.getProperty().getId());
        connParameters.setQueryObject(queryRepositoryObject.getQuery());
        connParameters.setQuery(queryRepositoryObject.getQuery().getValue());
        // first open Sql Builder,set true
        connParameters.setFirstOpenSqlBuilder(true);
    }
    Display display = Display.getCurrent();
    if (display == null) {
        display = Display.getDefault();
    }
    Shell parentShell = new Shell(display);
    TextUtil.setDialogTitle(TextUtil.SQL_BUILDER_TITLE_REP);
    Connection connection = dbConnectionItem.getConnection();
    String selectedContext = null;
    if (connection.isContextMode()) {
        ContextItem contextItem = ContextUtils.getContextItemById2(connection.getContextId());
        if (contextItem != null && connection.isContextMode()) {
            ContextSetsSelectionDialog setsDialog = new ContextSetsSelectionDialog(null, contextItem, false);
            setsDialog.open();
            selectedContext = setsDialog.getSelectedContext();
        }
    }
    SQLBuilderDialog dial = new SQLBuilderDialog(parentShell, repositoryNode, selectedContext);
    dial.setReadOnly(true);
    if (connection instanceof DatabaseConnection) {
        IMetadataConnection imetadataConnection = ConvertionHelper.convert(connection, true);
        connParameters.setSchema(imetadataConnection.getSchema() == null ? "" : imetadataConnection.getSchema());
        UIUtils.checkConnection(parentShell, imetadataConnection);
    }
    connParameters.setNodeReadOnly(true);
    connParameters.setFromRepository(true);
    dial.setConnParameters(connParameters);
    dial.open();
    refresh(repositoryNode);
}
Also used : ContextItem(org.talend.core.model.properties.ContextItem) ConnectionParameters(org.talend.core.sqlbuilder.util.ConnectionParameters) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) QueryRepositoryObject(org.talend.core.repository.model.repositoryObject.QueryRepositoryObject) Shell(org.eclipse.swt.widgets.Shell) ContextSetsSelectionDialog(org.talend.metadata.managment.ui.wizard.metadata.ContextSetsSelectionDialog) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) SQLBuilderDialog(org.talend.sqlbuilder.ui.SQLBuilderDialog) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory) Display(org.eclipse.swt.widgets.Display)

Example 22 with IMetadataConnection

use of org.talend.core.model.metadata.IMetadataConnection in project tdi-studio-se by Talend.

the class EditQueriesAction method doRun.

@Override
protected void doRun() {
    IStructuredSelection selection = (IStructuredSelection) getSelection();
    if (repositoryNode == null && selection != null) {
        repositoryNode = (RepositoryNode) selection.getFirstElement();
    }
    IProxyRepositoryFactory factory = ProxyRepositoryFactory.getInstance();
    IRepositoryViewObject nodeObject = repositoryNode.getObject();
    boolean locked = false;
    if (!factory.getRepositoryContext().isEditableAsReadOnly()) {
        if (nodeObject.getRepositoryStatus() == ERepositoryStatus.LOCK_BY_OTHER) {
            locked = true;
        }
    }
    // Avoid to delete node which is locked.
    if (locked || RepositoryManager.isOpenedItemInEditor(nodeObject)) {
        final String title = "Impossible to edit queries";
        String nodeName = nodeObject.getRepositoryObjectType().getLabel();
        final String message = "item is already locked by another user.";
        Display.getDefault().syncExec(new Runnable() {

            @Override
            public void run() {
                MessageDialog dialog = new MessageDialog(new Shell(), title, null, message, MessageDialog.ERROR, new String[] { IDialogConstants.OK_LABEL }, 0);
                dialog.open();
            }
        });
        return;
    }
    DatabaseConnectionItem dbConnectionItem = null;
    boolean readOnly = false;
    ConnectionParameters connParameters = new ConnectionParameters();
    if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CONNECTIONS) {
        dbConnectionItem = (DatabaseConnectionItem) repositoryNode.getObject().getProperty().getItem();
        connParameters.setRepositoryName(repositoryNode.getObject().getLabel());
        connParameters.setRepositoryId(repositoryNode.getObject().getId());
        //$NON-NLS-1$
        connParameters.setQuery("");
    } else if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CON_QUERY) {
        QueryRepositoryObject queryRepositoryObject = (QueryRepositoryObject) repositoryNode.getObject();
        readOnly = SubItemHelper.isDeleted(queryRepositoryObject.getAbstractMetadataObject());
        dbConnectionItem = (DatabaseConnectionItem) queryRepositoryObject.getProperty().getItem();
        connParameters.setRepositoryName(dbConnectionItem.getProperty().getLabel());
        connParameters.setRepositoryId(dbConnectionItem.getProperty().getId());
        connParameters.setQueryObject(queryRepositoryObject.getQuery());
        connParameters.setQuery(queryRepositoryObject.getQuery().getValue());
        // first open Sql Builder,set true
        connParameters.setFirstOpenSqlBuilder(true);
    } else if (repositoryNode.getObjectType() == ERepositoryObjectType.METADATA_CON_TABLE) {
        dbConnectionItem = (DatabaseConnectionItem) repositoryNode.getObject().getProperty().getItem();
        connParameters.setRepositoryName(dbConnectionItem.getProperty().getLabel());
        connParameters.setRepositoryId(dbConnectionItem.getProperty().getId());
        connParameters.setMetadataTable((MetadataTableRepositoryObject) repositoryNode.getObject());
        //$NON-NLS-1$
        connParameters.setQuery("");
    }
    IRepositoryView viewPart = getViewPart();
    Display display = null;
    if (viewPart != null) {
        display = viewPart.getViewer().getControl().getDisplay();
    } else {
        display = Display.getCurrent();
        if (display == null) {
            display = Display.getDefault();
        }
    }
    Shell parentShell = new Shell(display);
    TextUtil.setDialogTitle(TextUtil.SQL_BUILDER_TITLE_REP);
    Connection connection = dbConnectionItem.getConnection();
    String selectedContext = null;
    if (connection.isContextMode()) {
        ContextItem contextItem = ContextUtils.getContextItemById2(connection.getContextId());
        if (contextItem != null && connection.isContextMode()) {
            ContextSetsSelectionDialog setsDialog = new ContextSetsSelectionDialog(null, contextItem, false);
            setsDialog.open();
            selectedContext = setsDialog.getSelectedContext();
        }
    }
    SQLBuilderDialog dial = new SQLBuilderDialog(parentShell, repositoryNode, selectedContext);
    dial.setReadOnly(readOnly);
    if (connection instanceof DatabaseConnection) {
        IMetadataConnection imetadataConnection = ConvertionHelper.convert(connection, true);
        connParameters.setSchema(imetadataConnection.getSchema() == null ? "" : imetadataConnection.getSchema());
        UIUtils.checkConnection(parentShell, imetadataConnection);
    }
    connParameters.setNodeReadOnly(readOnly);
    connParameters.setFromRepository(true);
    dial.setConnParameters(connParameters);
    dial.open();
    IRepositoryView view = getViewPart();
    if (view != null) {
        view.refreshView();
    }
}
Also used : ContextItem(org.talend.core.model.properties.ContextItem) ConnectionParameters(org.talend.core.sqlbuilder.util.ConnectionParameters) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) Connection(org.talend.core.model.metadata.builder.connection.Connection) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) IRepositoryView(org.talend.repository.ui.views.IRepositoryView) DatabaseConnectionItem(org.talend.core.model.properties.DatabaseConnectionItem) Shell(org.eclipse.swt.widgets.Shell) QueryRepositoryObject(org.talend.core.repository.model.repositoryObject.QueryRepositoryObject) ContextSetsSelectionDialog(org.talend.metadata.managment.ui.wizard.metadata.ContextSetsSelectionDialog) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) MessageDialog(org.eclipse.jface.dialogs.MessageDialog) SQLBuilderDialog(org.talend.sqlbuilder.ui.SQLBuilderDialog) IProxyRepositoryFactory(org.talend.repository.model.IProxyRepositoryFactory) Display(org.eclipse.swt.widgets.Display)

Example 23 with IMetadataConnection

use of org.talend.core.model.metadata.IMetadataConnection in project tdi-studio-se by Talend.

the class SQLBuilderService method openSQLBuilderDialog.

public Dialog openSQLBuilderDialog(Shell parentShell, String processName, ConnectionParameters connParameters) {
    SQLBuilderDialog sqlBuilder = new SQLBuilderDialog(parentShell);
    UIUtils.addSqlBuilderDialog(processName, sqlBuilder);
    sqlBuilder.setConnParameters(connParameters);
    // display a error message if the db connection is failed.
    if (connParameters != null) {
        DatabaseConnection connection = createConnection(connParameters);
        if (connection != null) {
            IMetadataConnection metadataConnection = ConvertionHelper.convert(connection);
            UIUtils.checkConnection(parentShell, metadataConnection);
        }
    }
    return sqlBuilder;
}
Also used : DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) SQLBuilderDialog(org.talend.sqlbuilder.ui.SQLBuilderDialog)

Example 24 with IMetadataConnection

use of org.talend.core.model.metadata.IMetadataConnection in project tdi-studio-se by Talend.

the class GuessSchemaController method runShadowProcessForPerl.

private void runShadowProcessForPerl() {
    final ProgressMonitorDialog pmd = new ProgressMonitorDialog(this.composite.getShell());
    try {
        pmd.run(true, true, new IRunnableWithProgress() {

            @Override
            public void run(IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
                if (columns != null) {
                    columns.clear();
                }
                //$NON-NLS-1$
                monitor.beginTask(Messages.getString("GuessSchemaController.waitOpenDatabase"), IProgressMonitor.UNKNOWN);
                if (connParameters == null) {
                    initConnectionParameters();
                }
                ISQLBuilderService service = (ISQLBuilderService) GlobalServiceRegister.getDefault().getService(ISQLBuilderService.class);
                DatabaseConnection connt = service.createConnection(connParameters);
                IMetadataConnection iMetadataConnection = null;
                boolean isStatus = false;
                ExtractMetaDataUtils extractMeta = ExtractMetaDataUtils.getInstance();
                if (connt != null) {
                    iMetadataConnection = ConvertionHelper.convert(connt);
                    isStatus = checkConnection(iMetadataConnection);
                }
                if (!monitor.isCanceled()) {
                    try {
                        if (isStatus) {
                            extractMeta.getConnection(iMetadataConnection.getDbType(), iMetadataConnection.getUrl(), iMetadataConnection.getUsername(), iMetadataConnection.getPassword(), iMetadataConnection.getDatabase(), iMetadataConnection.getSchema(), iMetadataConnection.getDriverClass(), iMetadataConnection.getDriverJarPath(), iMetadataConnection.getDbVersionString(), iMetadataConnection.getAdditionalParams());
                            if (extractMeta.getConn() != null) {
                                Statement smst = extractMeta.getConn().createStatement();
                                extractMeta.setQueryStatementTimeout(smst);
                                ResultSet rs = smst.executeQuery(memoSQL);
                                ResultSetMetaData rsmd = rs.getMetaData();
                                int numbOfColumn = rsmd.getColumnCount();
                                int count = 0;
                                List<String[]> cvsArrays = new ArrayList<String[]>();
                                while (rs.next() && count < 50) {
                                    String[] dataOneRow = new String[numbOfColumn];
                                    for (int i = 1; i <= numbOfColumn; i++) {
                                        String tempStr = rs.getString(i);
                                        dataOneRow[i - 1] = tempStr;
                                    }
                                    cvsArrays.add(dataOneRow);
                                    count++;
                                }
                                refreshMetaDataTable(rsmd, cvsArrays);
                                extractMeta.closeConnection();
                            }
                        } else {
                            Display.getDefault().asyncExec(new Runnable() {

                                @Override
                                public void run() {
                                    //$NON-NLS-1$
                                    String pid = "org.talend.sqlbuilder";
                                    //$NON-NLS-1$
                                    String mainMsg = "Database connection is failed. ";
                                    ErrorDialogWithDetailAreaAndContinueButton dialog = new ErrorDialogWithDetailAreaAndContinueButton(composite.getShell(), pid, mainMsg, connParameters.getConnectionComment());
                                    if (dialog.getCodeOfButton() == Window.OK) {
                                        openParamemerDialog(composite.getShell(), part.getProcess().getContextManager());
                                    }
                                }
                            });
                        }
                    } catch (Exception e) {
                        extractMeta.closeConnection();
                        ExceptionHandler.process(e);
                        final String strExcepton = "Connect to DB error ,or some errors in SQL query string, or 'Guess Schema' not compatible with current SQL query string." + System.getProperty("line.separator");
                        Display.getDefault().asyncExec(new Runnable() {

                            @Override
                            public void run() {
                                MessageDialog.openWarning(composite.getShell(), Messages.getString("GuessSchemaController.connError"), //$NON-NLS-1$
                                strExcepton);
                            }
                        });
                    }
                }
            }
        });
    } catch (Exception e) {
        ExceptionHandler.process(e);
    }
}
Also used : ErrorDialogWithDetailAreaAndContinueButton(org.talend.commons.ui.swt.dialogs.ErrorDialogWithDetailAreaAndContinueButton) Statement(java.sql.Statement) ProgressMonitorDialog(org.eclipse.jface.dialogs.ProgressMonitorDialog) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) ExtractMetaDataUtils(org.talend.core.model.metadata.builder.database.ExtractMetaDataUtils) InvocationTargetException(java.lang.reflect.InvocationTargetException) ISQLBuilderService(org.talend.core.ui.services.ISQLBuilderService) InvocationTargetException(java.lang.reflect.InvocationTargetException) SQLException(java.sql.SQLException) ProcessorException(org.talend.designer.runprocess.ProcessorException) IRunnableWithProgress(org.eclipse.jface.operation.IRunnableWithProgress) ResultSetMetaData(java.sql.ResultSetMetaData) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) ResultSet(java.sql.ResultSet) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) List(java.util.List) ArrayList(java.util.ArrayList)

Example 25 with IMetadataConnection

use of org.talend.core.model.metadata.IMetadataConnection in project tdi-studio-se by Talend.

the class DbTableController method openDbTableSelectorJob.

/**
     * qzhang Comment method "openDbTableSelectorJob".
     * 
     * @param openListTable
     */
private void openDbTableSelectorJob(final Button openListTable) {
    Job job = new //$NON-NLS-1$
    Job(//$NON-NLS-1$
    Messages.getString("DbTableController.openSelectionDialog")) {

        @Override
        protected IStatus run(final IProgressMonitor monitor) {
            //$NON-NLS-1$
            monitor.beginTask(Messages.getString("DbTableController.waitingForOpen"), IProgressMonitor.UNKNOWN);
            DatabaseConnection existConnection = getExistConnection();
            if (existConnection == null) {
                if (connParameters == null) {
                    initConnectionParameters();
                }
                existConnection = TracesConnectionUtils.createConnection(connParameters);
            }
            final DatabaseConnection con = existConnection;
            IMetadataConnection iMetadataConnection = null;
            final IMetadataConnection[] iMetadata = new IMetadataConnection[1];
            boolean isStatus = false;
            if (existConnection != null) {
                Display.getDefault().syncExec(new Runnable() {

                    @Override
                    public void run() {
                        IMetadataConnection convert = ConvertionHelper.convert(con);
                        iMetadata[0] = convert;
                    }
                });
                iMetadataConnection = iMetadata[0];
                // Added by Marvin Wang for bug TDI-24288.
                if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(con.getDatabaseType())) {
                    if (EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue().equalsIgnoreCase(con.getDbVersionString())) {
                        try {
                            HiveConnectionManager.getInstance().checkConnection(iMetadataConnection);
                            isStatus = true;
                        } catch (ClassNotFoundException e) {
                            isStatus = false;
                            ExceptionHandler.process(e);
                        } catch (InstantiationException e) {
                            isStatus = false;
                            ExceptionHandler.process(e);
                        } catch (IllegalAccessException e) {
                            isStatus = false;
                            ExceptionHandler.process(e);
                        } catch (SQLException e) {
                            isStatus = false;
                            ExceptionHandler.process(e);
                        }
                    }
                } else {
                    isStatus = checkConnection(iMetadataConnection);
                }
            }
            String type = null;
            if (iMetadataConnection != null) {
                type = iMetadataConnection.getDbType();
            }
            final String dbType = type;
            if (!monitor.isCanceled()) {
                try {
                    if (isStatus) {
                        // Added by Marvin Wang for bug TDI-24288.
                        if (EDatabaseTypeName.HIVE.getProduct().equalsIgnoreCase(con.getDatabaseType())) {
                            if (EDatabaseVersion4Drivers.HIVE_EMBEDDED.getVersionValue().equalsIgnoreCase(con.getDbVersionString())) {
                                JavaSqlFactory.doHivePreSetup((DatabaseConnection) iMetadataConnection.getCurrentConnection());
                                returnTablesFormConnection = ExtractMetaDataFromDataBase.fetchAllTablesForHiveEmbeddedModel(iMetadataConnection);
                                JavaSqlFactory.doHiveConfigurationClear();
                            }
                        } else {
                            returnTablesFormConnection = ExtractMetaDataFromDataBase.returnTablesFormConnection(iMetadataConnection);
                        }
                        Display.getDefault().asyncExec(new Runnable() {

                            @Override
                            public void run() {
                                final DbTableSelectorObject object = new DbTableSelectorObject();
                                DbTableSelectorObject connO = new DbTableSelectorObject();
                                if (dbType != null && dbType.equals(EDatabaseTypeName.ORACLE_OCI.getDisplayName())) {
                                    connO.setLabel(connParameters.getLocalServiceName());
                                } else if ("".equals(connParameters.getDbName())) {
                                    //$NON-NLS-1$
                                    connO.setLabel(connParameters.getDatasource());
                                } else {
                                    connO.setLabel(connParameters.getDbName());
                                }
                                // ...
                                if (connO.getLabel() == null || connO.getLabel().equals("")) {
                                    //$NON-NLS-1$
                                    if (elem instanceof INode) {
                                        connO.setLabel(elem.getElementName());
                                    } else {
                                        connO.setLabel("tJDBCConnection");
                                    }
                                }
                                connO.setType(ObjectType.DB);
                                if (monitor.isCanceled()) {
                                    monitor.done();
                                    return;
                                }
                                for (String string : returnTablesFormConnection) {
                                    DbTableSelectorObject tableO = new DbTableSelectorObject();
                                    tableO.setLabel(string);
                                    tableO.setType(ObjectType.TABLE);
                                    connO.addChildren(tableO);
                                }
                                object.addChildren(connO);
                                String propertyName = (String) openListTable.getData(PARAMETER_NAME);
                                DbTableSelectorDialog selectorDialog = new DbTableSelectorDialog(composite.getShell(), object);
                                if (selectorDialog.open() == DbTableSelectorDialog.OK) {
                                    String name = selectorDialog.getSelectName();
                                    if (name != null) {
                                        Command dbSelectorCommand = new PropertyChangeCommand(elem, propertyName, TalendTextUtils.addQuotes(name));
                                        executeCommand(dbSelectorCommand);
                                        Text labelText = (Text) hashCurControls.get(propertyName);
                                        labelText.setText(TalendTextUtils.addQuotes(name));
                                    }
                                }
                            }
                        });
                    } else {
                        Display.getDefault().asyncExec(new Runnable() {

                            @Override
                            public void run() {
                                //$NON-NLS-1$
                                String pid = "org.talend.sqlbuilder";
                                //$NON-NLS-1$
                                String mainMsg = "Database connection is failed. ";
                                ErrorDialogWithDetailAreaAndContinueButton dialog = new ErrorDialogWithDetailAreaAndContinueButton(composite.getShell(), pid, mainMsg, connParameters.getConnectionComment());
                                if (dialog.getCodeOfButton() == Window.OK) {
                                    openParamemerDialog(openListTable, part.getProcess().getContextManager());
                                }
                            }
                        });
                    }
                } catch (SQLException e) {
                    // Added by Marvin Wang for bug TDI-24288.
                    JavaSqlFactory.doHiveConfigurationClear();
                    ExceptionHandler.process(e);
                    Display.getDefault().asyncExec(new Runnable() {

                        @Override
                        public void run() {
                            MessageDialog.openError(openListTable.getShell(), //$NON-NLS-1$
                            Messages.getString("DbTableController.dialog.title"), //$NON-NLS-1$
                            Messages.getString("DbTableController.dialog.contents.fetchTableFailed"));
                        }
                    });
                } catch (ClassNotFoundException e) {
                    e.printStackTrace();
                } catch (InstantiationException e) {
                    e.printStackTrace();
                } catch (IllegalAccessException e) {
                    e.printStackTrace();
                }
            }
            monitor.done();
            return Status.OK_STATUS;
        }
    };
    if (part != null) {
        IWorkbenchSiteProgressService siteps = (IWorkbenchSiteProgressService) part.getSite().getAdapter(IWorkbenchSiteProgressService.class);
        siteps.showInDialog(composite.getShell(), job);
    } else {
        PlatformUI.getWorkbench().getProgressService().showInDialog(composite.getShell(), job);
    }
    job.setUser(true);
    job.schedule();
}
Also used : ErrorDialogWithDetailAreaAndContinueButton(org.talend.commons.ui.swt.dialogs.ErrorDialogWithDetailAreaAndContinueButton) INode(org.talend.core.model.process.INode) SQLException(java.sql.SQLException) IMetadataConnection(org.talend.core.model.metadata.IMetadataConnection) Text(org.eclipse.swt.widgets.Text) DbTableSelectorDialog(org.talend.core.ui.metadata.dialog.DbTableSelectorDialog) DbTableSelectorObject(org.talend.core.ui.metadata.dialog.DbTableSelectorObject) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) PropertyChangeCommand(org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand) IWorkbenchSiteProgressService(org.eclipse.ui.progress.IWorkbenchSiteProgressService) Command(org.eclipse.gef.commands.Command) PropertyChangeCommand(org.talend.designer.core.ui.editor.cmd.PropertyChangeCommand) DatabaseConnection(org.talend.core.model.metadata.builder.connection.DatabaseConnection) Job(org.eclipse.core.runtime.jobs.Job)

Aggregations

IMetadataConnection (org.talend.core.model.metadata.IMetadataConnection)38 DatabaseConnection (org.talend.core.model.metadata.builder.connection.DatabaseConnection)27 SQLException (java.sql.SQLException)18 Connection (org.talend.core.model.metadata.builder.connection.Connection)14 ArrayList (java.util.ArrayList)12 List (java.util.List)7 MetadataFillFactory (org.talend.metadata.managment.model.MetadataFillFactory)7 ReturnCode (org.talend.utils.sugars.ReturnCode)7 Properties (java.util.Properties)6 PersistenceException (org.talend.commons.exception.PersistenceException)6 DatabaseConnectionItem (org.talend.core.model.properties.DatabaseConnectionItem)6 DatabaseMetaData (java.sql.DatabaseMetaData)5 DBConnectionParameter (org.talend.dq.analysis.parameters.DBConnectionParameter)5 Shell (org.eclipse.swt.widgets.Shell)4 ErrorDialogWithDetailAreaAndContinueButton (org.talend.commons.ui.swt.dialogs.ErrorDialogWithDetailAreaAndContinueButton)4 DelimitedFileConnection (org.talend.core.model.metadata.builder.connection.DelimitedFileConnection)4 TypedReturnCode (org.talend.utils.sugars.TypedReturnCode)4 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 Connection (java.sql.Connection)3 ResultSet (java.sql.ResultSet)3