use of org.jkiss.dbeaver.ext.exasol.model.app.ExasolServerSession in project dbeaver by serge-rider.
the class ExasolUtils method readSessions.
public static Collection<ExasolServerSession> readSessions(DBRProgressMonitor progressMonitor, JDBCSession session) throws SQLException {
LOG.debug("read sessions");
List<ExasolServerSession> listSessions = new ArrayList<>();
//check dba view
try {
try (JDBCStatement dbStat = session.createStatement()) {
try (JDBCResultSet dbResult = dbStat.executeQuery(SESS_DBA_QUERY)) {
while (dbResult.next()) {
listSessions.add(new ExasolServerSession(dbResult));
}
}
}
//now try all view
} catch (SQLException e) {
try (JDBCStatement dbStat = session.createStatement()) {
try (JDBCResultSet dbResult = dbStat.executeQuery(SESS_ALL_QUERY)) {
while (dbResult.next()) {
listSessions.add(new ExasolServerSession(dbResult));
}
}
}
}
return listSessions;
}
Aggregations