Search in sources :

Example 16 with JDBCExecutionContext

use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by dbeaver.

the class PostgreDebugController method attachSession.

@Override
public void attachSession(DBGSession session, DBCExecutionContext sessionContext, Map<String, Object> configuration, DBRProgressMonitor monitor) throws DBException {
    PostgreDebugSession pgSession = (PostgreDebugSession) session;
    JDBCExecutionContext sessionJdbc = (JDBCExecutionContext) sessionContext;
    int oid = Integer.parseInt(String.valueOf(configuration.get(PROCEDURE_OID)));
    int pid = Integer.parseInt(String.valueOf(configuration.get(ATTACH_PROCESS)));
    String kind = String.valueOf(configuration.get(ATTACH_KIND));
    boolean global = DBGController.ATTACH_KIND_GLOBAL.equals(kind);
    String call = (String) configuration.get(SCRIPT_TEXT);
    pgSession.attach(sessionJdbc, oid, pid, global, call);
}
Also used : JDBCExecutionContext(org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext)

Example 17 with JDBCExecutionContext

use of org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext in project dbeaver by dbeaver.

the class DB2DataSource method setDefaultObject.

@Override
public void setDefaultObject(@NotNull DBRProgressMonitor monitor, @NotNull DBSObject object) throws DBException {
    final DB2Schema oldSelectedEntity = getDefaultObject();
    if (!(object instanceof DB2Schema)) {
        throw new IllegalArgumentException("Invalid object type: " + object);
    }
    for (JDBCExecutionContext context : getAllContexts()) {
        setCurrentSchema(monitor, context, (DB2Schema) object);
    }
    activeSchemaName = object.getName();
    // Send notifications
    if (oldSelectedEntity != null) {
        DBUtils.fireObjectSelect(oldSelectedEntity, false);
    }
    if (this.activeSchemaName != null) {
        DBUtils.fireObjectSelect(object, true);
    }
}
Also used : JDBCExecutionContext(org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext)

Aggregations

JDBCExecutionContext (org.jkiss.dbeaver.model.impl.jdbc.JDBCExecutionContext)17 DBException (org.jkiss.dbeaver.DBException)5 Connection (java.sql.Connection)1 SQLException (java.sql.SQLException)1 DBPConnectionConfiguration (org.jkiss.dbeaver.model.connection.DBPConnectionConfiguration)1