private Map < String , Integer > getSlaveStatus ( final Connection conn ) throws SQLException { Map < String , Integer > map = new HashMap < String , Integer > ( ) ; String query = SLAVE_STATUS_QRY ; Statement statement = null ; ResultSet rs = null ; try { if ( conn != null ) { statement = conn . createStatement ( ) ; rs = statement . executeQuery ( query ) ; while ( rs . next ( ) ) { map . put ( "Slave_IO_Running" , rs . getInt ( "Slave_IO_Running" ) ) ; map . put ( "Slave_SQL_Running" , rs . getInt ( "Slave_SQL_Running" ) ) ; map . put ( "Seconds_Behind_Master" , rs . getInt ( "Seconds_Behind_Master" ) ) ; } } } finally { DBUtils . closeQuietly ( rs ) ; DBUtils . closeQuietly ( statement ) ; } return map ; }
Get slave statuses .