protected void maintenance ( final String action , final String table ) throws PersistenceException { executeUpdate ( new Operation < Object > ( ) { public Object invoke ( Connection conn , DatabaseLiaison liaison ) throws SQLException , PersistenceException { Statement stmt = null ; try { stmt = conn . createStatement ( ) ; ResultSet rs = stmt . executeQuery ( action + " table " + table ) ; while ( rs . next ( ) ) { String result = rs . getString ( "Msg_text" ) ; if ( result == null || ( result . indexOf ( "up to date" ) == - 1 && ! result . equals ( "OK" ) ) ) { log . info ( "Table maintenance [" + SimpleRepository . toString ( rs ) + "]." ) ; } } } finally { JDBCUtil . close ( stmt ) ; } return null ; } } ) ; }
Instructs MySQL to perform table maintenance on the specified table .