use of org.jkiss.dbeaver.debug.DBGException in project dbeaver by dbeaver.
the class PostgreDebugSession method getSource.
/**
* Return source for func OID in debug session
*
* @return String
*/
public String getSource(int OID) throws DBGException {
acquireReadLock();
String src = "";
String sql = SQL_GET_SRC.replaceAll("\\?sessionid", String.valueOf(sessionId)).replaceAll("\\?oid", String.valueOf(OID));
try (Statement stmt = getConnection().createStatement();
ResultSet rs = stmt.executeQuery(sql)) {
while (rs.next()) {
src = rs.getString(1);
}
} catch (SQLException e) {
throw new DBGException("SQL error", e);
} finally {
lock.readLock().unlock();
}
return src;
}
use of org.jkiss.dbeaver.debug.DBGException in project dbeaver by dbeaver.
the class DebugCore method findProcedureController.
public static DBGController findProcedureController(DBPDataSourceContainer dataSourceContainer) throws DBGException {
DBGController controller = Adapters.adapt(dataSourceContainer, DBGController.class);
if (controller != null) {
return controller;
}
String providerId = dataSourceContainer.getDriver().getProviderId();
String message = NLS.bind("Unable to find controller for datasource \"{0}\"", providerId);
throw new DBGException(message);
}
use of org.jkiss.dbeaver.debug.DBGException in project dbeaver by dbeaver.
the class DatabaseDebugTarget method resume.
@Override
public void resume() throws DebugException {
suspended = false;
try {
controller.resume(sessionKey);
} catch (DBGException e) {
String message = NLS.bind("Error resuming {0}", getName());
IStatus status = DebugCore.newErrorStatus(message, e);
throw new DebugException(status);
}
if (thread.isSuspended()) {
thread.resumedByTarget();
}
fireResumeEvent(DebugEvent.CLIENT_REQUEST);
}
use of org.jkiss.dbeaver.debug.DBGException in project dbeaver by dbeaver.
the class DatabaseDebugTarget method breakpointAdded.
@Override
public void breakpointAdded(IBreakpoint breakpoint) {
if (!terminated) {
DBGBreakpointDescriptor descriptor = describeBreakpoint(breakpoint);
if (descriptor == null) {
String message = NLS.bind("Unable to describe breakpoint {0}", breakpoint);
Status error = DebugCore.newErrorStatus(message);
DebugCore.log(error);
return;
}
try {
controller.addBreakpoint(sessionKey, descriptor);
} catch (DBGException e) {
String message = NLS.bind("Unable to add breakpoint {0}", breakpoint);
Status error = DebugCore.newErrorStatus(message, e);
DebugCore.log(error);
}
}
}
Aggregations