use of org.jkiss.dbeaver.debug.DBGVariable in project dbeaver by dbeaver.
the class PostgreDebugSession method getVariables.
@Override
public List<DBGVariable<?>> getVariables() throws DBGException {
acquireReadLock();
List<DBGVariable<?>> vars = new ArrayList<>();
String sql = SQL_GET_VARS.replaceAll("\\?sessionid", String.valueOf(sessionId));
try (Statement stmt = getConnection().createStatement();
ResultSet rs = stmt.executeQuery(sql)) {
while (rs.next()) {
String name = rs.getString("name");
String varclass = rs.getString("varclass");
int linenumber = rs.getInt("linenumber");
boolean isunique = rs.getBoolean("isunique");
boolean isconst = rs.getBoolean("isconst");
boolean isnotnull = rs.getBoolean("isnotnull");
int dtype = rs.getInt("dtype");
String value = rs.getString("value");
PostgreDebugVariable var = new PostgreDebugVariable(name, varclass, linenumber, isunique, isconst, isnotnull, dtype, value);
vars.add(var);
}
} catch (SQLException e) {
throw new DBGException("SQL error", e);
} finally {
lock.readLock().unlock();
}
return vars;
}
Aggregations