private static void shutDownMySQLAbandonedConnectionCleanupThread(ClassLoader classLoader){
  try {
    Class<?> mysqlCleanupThreadClass;
    try {
      mysqlCleanupThreadClass=classLoader.loadClass("com.mysql.jdbc.AbandonedConnectionCleanupThread");
    }
 catch (    ClassNotFoundException e) {
      LOG.trace("Failed to load MySQL abandoned connection cleanup thread class. Presuming DB App is " + "not being run with MySQL and ignoring",e);
      return;
    }
    Method shutdownMethod=mysqlCleanupThreadClass.getMethod("shutdown");
    shutdownMethod.invoke(null);
    LOG.debug("Successfully shutdown MySQL connection cleanup thread.");
  }
 catch (  Throwable e) {
    LOG.warn("Failed to shutdown MySQL connection cleanup thread. Ignoring.",e);
  }
}

private static void shutDownMySQLAbandonedConnectionCleanupThread ( ClassLoader classLoader ) { try { Class < ? > mysqlCleanupThreadClass ; try { mysqlCleanupThreadClass = classLoader . loadClass ( "com.mysql.jdbc.AbandonedConnectionCleanupThread" ) ; } catch ( ClassNotFoundException e ) { LOG . trace ( "Failed to load MySQL abandoned connection cleanup thread class. Presuming DB App is " + "not being run with MySQL and ignoring" , e ) ; return ; } Method shutdownMethod = mysqlCleanupThreadClass . getMethod ( "shutdown" ) ; shutdownMethod . invoke ( null ) ; LOG . debug ( "Successfully shutdown MySQL connection cleanup thread." ) ; } catch ( Throwable e ) { LOG . warn ( "Failed to shutdown MySQL connection cleanup thread. Ignoring." , e ) ; } }
shuts down a cleanup thread com . mysql . jdbc . abandonedconnectioncleanupthread that mysql driver fails to destroy if this is not done , the thread keeps a reference to the classloader , thereby causing ooms or too many open files
