code: public static Connection getConnection(final String jdbcURL) throws SQLException {
          try {
              return getRealConnection(jdbcURL);
          } catch (final SQLException sqlException) {
              try {
                  return (Connection) AccessController.doPrivileged(new PrivilegedExceptionAction() {
                      public Object run() throws Exception {
                          final ClassLoader cl = Thread.currentThread().getContextClassLoader();
                          if (cl != null && cl != DriverManagerAccessor.class.getClassLoader()) {
                              final Class<?> definedClass = DriverManagerAccessorSupport.define(cl);
                              final Method method = definedClass.getDeclaredMethod("getRealConnection", String.class);
                              method.setAccessible(true);
                              return (Connection) method.invoke(null, jdbcURL);
  
                          } else {
                              throw sqlException;
                          }
                      }
                  });
              } catch (PrivilegedActionException e) {
                  throw sqlException;
              }
          }
      }
docs: Delegates to {@link java.sql.DriverManager#getConnection(String)}. If this fails it attempts to
  load a class into the class loader cl and tries again.
  
  @param jdbcURL The JDBC url
  @return A database connection