code: public static void deregisterAllDrivers ()
    {
      final Enumeration <Driver> aAllDrivers = DriverManager.getDrivers ();
      while (aAllDrivers.hasMoreElements ())
      {
        final Driver aDriver = aAllDrivers.nextElement ();
        try
        {
          DriverManager.deregisterDriver (aDriver);
          LOGGER.info ("Deregistered JDBC driver " + aDriver);
        }
        catch (final SQLException ex)
        {
          LOGGER.error ("Failed to deregister JDBC driver " + aDriver, ex);
        }
      }
    }
docs: Unregister all JDBC drivers, still registered in the {@link DriverManager}.
  This method should be called upon application shutdown!