code: private static Connection getConnection(
          String url, java.util.Properties info, ClassLoader callerCL) throws SQLException {
          /*
           * When callerCl is null, we should check the application's
           * (which is invoking this class indirectly)
           * classloader, so that the JDBC driver class outside rt.jar
           * can be loaded from here.
           */
          synchronized (DriverManager.class) {
              // synchronize loading of the correct classloader.
              if (callerCL == null) {
                  callerCL = Thread.currentThread().getContextClassLoader();
              }
          }
  
          if(url == null) {
              throw new SQLException("The url cannot be null", "08001");
          }
  
          println("DriverManager.getConnection(\"" + url + "\")");
  
          // Walk through the loaded registeredDrivers attempting to make a connection.
          // Remember the first exception that gets raised so we can reraise it.
          SQLException reason = null;
  
          for(DriverInfo aDriver : registeredDrivers) {
              // If the caller does not have permission to load the driver then
              // skip it.
              if(isDriverAllowed(aDriver.driver, callerCL)) {
                  try {
                      println("    trying " + aDriver.driver.getClass().getName());
                      Connection con = aDriver.driver.connect(url, info);
                      if (con != null) {
                          // Success!
                          println("getConnection returning " + aDriver.driver.getClass().getName());
                          return (con);
                      }
                  } catch (SQLException ex) {
                      if (reason == null) {
                          reason = ex;
                      }
                  }
  
              } else {
                  println("    skipping: " + aDriver.getClass().getName());
              }
  
          }
  
          // if we got here nobody could connect.
          if (reason != null)    {
              println("getConnection failed: " + reason);
              throw reason;
          }
  
          println("getConnection: no suitable driver found for "+ url);
          throw new SQLException("No suitable driver found for "+ url, "08001");
      }
docs: Worker method called by the public getConnection() methods.