code: public static Class<?> define(ClassLoader loader) {
  
          try {
              SecurityManager sm = System.getSecurityManager();
              if (sm != null) {
                  String packageName = DriverManagerAccessor.class.getPackage().getName();
                  RuntimePermission permission = new RuntimePermission("defineClassInPackage." + packageName);
                  sm.checkPermission(permission);
              }
  
              byte[] b = loadBytes();
              Object[] args = new Object[]{DriverManagerAccessor.class.getName().replace('/', '.'), b, new Integer(0), new Integer(b.length)};
              Class<?> clazz = (Class<?>) defineClass.invoke(loader, args);
              return clazz;
          } catch (RuntimeException e) {
              //we have to attempt to define the class first
              //otherwise it may be returned by a different class loader
              try {
                  return loader.loadClass(DriverManagerAccessor.class.getName());
              } catch (ClassNotFoundException ex) {
                  //ignore
              }
              throw e;
          } catch (Exception e) {
              try {
                  return loader.loadClass(DriverManagerAccessor.class.getName());
              } catch (ClassNotFoundException ex) {
                  //ignore
              }
              throw new RuntimeException(e);
          }
      }
docs: Definines the class using the given ClassLoader and ProtectionDomain