Search in sources :

Example 1 with ExasolConnection

use of org.jkiss.dbeaver.ext.exasol.model.ExasolConnection in project dbeaver by dbeaver.

the class ExasolConnectionManager method addObjectDeleteActions.

@Override
protected void addObjectDeleteActions(List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
    final ExasolConnection con = command.getObject();
    actions.add(new SQLDatabasePersistAction("Drop Connection", "DROP CONNECTION " + DBUtils.getQuotedIdentifier(con)));
}
Also used : ExasolConnection(org.jkiss.dbeaver.ext.exasol.model.ExasolConnection) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Example 2 with ExasolConnection

use of org.jkiss.dbeaver.ext.exasol.model.ExasolConnection in project dbeaver by dbeaver.

the class ExasolConnectionManager method addObjectRenameActions.

@Override
protected void addObjectRenameActions(List<DBEPersistAction> actions, ObjectRenameCommand command, Map<String, Object> options) {
    ExasolConnection obj = command.getObject();
    actions.add(new SQLDatabasePersistAction("Rename Connection", "RENAME CONNECTION " + DBUtils.getQuotedIdentifier(obj.getDataSource(), command.getOldName()) + " to " + DBUtils.getQuotedIdentifier(obj.getDataSource(), command.getNewName())));
}
Also used : ExasolConnection(org.jkiss.dbeaver.ext.exasol.model.ExasolConnection) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Example 3 with ExasolConnection

use of org.jkiss.dbeaver.ext.exasol.model.ExasolConnection in project dbeaver by dbeaver.

the class ExasolConnectionManager method addObjectCreateActions.

@Override
protected void addObjectCreateActions(List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options) {
    final ExasolConnection con = command.getObject();
    StringBuilder script = new StringBuilder(String.format("CREATE CONNECTION %s TO ", DBUtils.getQuotedIdentifier(con)));
    script.append(" '" + ExasolUtils.quoteString(con.getConnectionString()) + "' ");
    if (!(con.getUserName().isEmpty() | con.getPassword().isEmpty())) {
        script.append(String.format("USER '%s' IDENTIFIED BY '%s'", ExasolUtils.quoteString(con.getUserName()), ExasolUtils.quoteString(con.getPassword())));
    }
    actions.add(new SQLDatabasePersistAction("Create Connection", script.toString()));
    if (!con.getDescription().isEmpty()) {
        actions.add(Comment(con));
    }
}
Also used : ExasolConnection(org.jkiss.dbeaver.ext.exasol.model.ExasolConnection) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Example 4 with ExasolConnection

use of org.jkiss.dbeaver.ext.exasol.model.ExasolConnection in project dbeaver by serge-rider.

the class ExasolConnectionManager method addObjectCreateActions.

@Override
protected void addObjectCreateActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectCreateCommand command, Map<String, Object> options) {
    final ExasolConnection con = command.getObject();
    StringBuilder script = new StringBuilder(String.format("CREATE CONNECTION %s TO ", DBUtils.getQuotedIdentifier(con)));
    script.append(" '" + ExasolUtils.quoteString(con.getConnectionString()) + "' ");
    if (!(con.getUserName().isEmpty() | con.getPassword().isEmpty())) {
        script.append(String.format("USER '%s' IDENTIFIED BY '%s'", ExasolUtils.quoteString(con.getUserName()), ExasolUtils.quoteString(con.getPassword())));
    }
    actions.add(new SQLDatabasePersistAction("Create Connection", script.toString()));
    if (!con.getDescription().isEmpty()) {
        actions.add(getCommentCommand(con));
    }
}
Also used : ExasolConnection(org.jkiss.dbeaver.ext.exasol.model.ExasolConnection) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Example 5 with ExasolConnection

use of org.jkiss.dbeaver.ext.exasol.model.ExasolConnection in project dbeaver by serge-rider.

the class ExasolConnectionManager method addObjectDeleteActions.

@Override
protected void addObjectDeleteActions(DBRProgressMonitor monitor, DBCExecutionContext executionContext, List<DBEPersistAction> actions, ObjectDeleteCommand command, Map<String, Object> options) {
    final ExasolConnection con = command.getObject();
    actions.add(new SQLDatabasePersistAction("Drop Connection", "DROP CONNECTION " + DBUtils.getQuotedIdentifier(con)));
}
Also used : ExasolConnection(org.jkiss.dbeaver.ext.exasol.model.ExasolConnection) SQLDatabasePersistAction(org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)

Aggregations

ExasolConnection (org.jkiss.dbeaver.ext.exasol.model.ExasolConnection)12 SQLDatabasePersistAction (org.jkiss.dbeaver.model.impl.edit.SQLDatabasePersistAction)12 ConfirmationDialog (org.jkiss.dbeaver.ui.dialogs.ConfirmationDialog)1