* @return terminal sessions with host information
*/
public static SessionAudit getSessionsTerminals(Long sessionId) {
//get db connection
Connection con = null;
SessionAudit sessionAudit = new SessionAudit();
String sql = "select * from session_log, users where users.id= session_log.user_id and session_log.id = ? ";
try {
con = DBUtils.getConn();
PreparedStatement stmt = con.prepareStatement(sql);
stmt.setLong(1, sessionId);
ResultSet rs = stmt.executeQuery();
while (rs.next()) {
sessionAudit.setId(rs.getLong("session_log.id"));
sessionAudit.setSessionTm(rs.getTimestamp("session_tm"));
sessionAudit.setUser(UserDB.getUser(con, rs.getLong("user_id")));
sessionAudit.setHostSystemList(getHostSystemsForSession(con, sessionId));
}