question: @ Override public List < Session > listSessions ( ) throws SQLException { String sql = "show processlist" ; Statement stmt = null ; ResultSet rs = null ; LinkedList < Session > sessions = new LinkedList < Session > ( ) ; try { stmt = dbConn . createStatement ( ) ; rs = stmt . executeQuery ( sql ) ; while ( rs . next ( ) ) { Session session = new Session ( ) ; session . setIdentifier ( rs . getString ( "Id" ) ) ; session . setLogin ( rs . getString ( "User" ) ) ; sessions . add ( session ) ; } } finally { if ( rs != null ) rs . close ( ) ; if ( stmt != null ) stmt . close ( ) ; } return sessions ; }
target:  Issue SHOW PROCESSLIST command to get a list of all currently available sessions.