AR-SQLServer-Adapter naming
 @override
183325
def exec_query(sql, name = 'SQL', binds = [])
      # NOTE: we allow to execute SQL as requested returning a results.
      # e.g. this allows to use SQLServer's EXEC with a result set ...
      sql = to_sql(sql, binds) if sql.respond_to?(:to_sql)

      sql = repair_special_columns(sql)
      if prepared_statements?
        log(sql, name, binds) { @connection.execute_query(sql, binds) }
      else
        log(sql, name) { @connection.execute_query(sql) }
      end
    end
482209
private static function loadAdapterClass($adapter)
	{
		$class = ucwords($adapter) . 'Adapter';
		$fqclass = 'ActiveRecord\\' . $class;
		$source = __DIR__ . "/Adapters/$class.php";

		if (!file_exists($source))
			throw new DatabaseException("$fqclass not found!");

		require_once($source);
		return $fqclass;
	}
196650
function getAdapter(serviceInfo, resource, moduleStack) {
        var adapterName = serviceInfo.adapterName;

        // if adapter name is 'service' and there is a default, switch to the default
        if (adapterName === 'service' && resource.adapters[this.injector.container]) {
            adapterName = serviceInfo.adapterName = resource.adapters[this.injector.container];
            serviceInfo.adapterImpl = this.injector.adapterMap[adapterName];
            serviceInfo.serviceName = utils.getCamelCase(serviceInfo.resourceName + '.' +
                serviceInfo.adapterName + '.service');
        }

        // if that doesn't work, we will assume the adapter is in the current codebase, so go get it
        var overridePath = '/resources/' + serviceInfo.resourceName + '/' + serviceInfo.resourceName + '.' +
            (adapterName === 'service' ? adapterName : adapterName + '.service');
        var adapterPath = '/adapters/' + adapterName + '/' +
            serviceInfo.adapterImpl + '.' + adapterName + '.adapter';

        // if override exists, use that one, else use the lower level adapter
        var Adapter =
            this.loadIfExists(overridePath, moduleStack, null) ||
            this.injector.adapters[serviceInfo.adapterImpl] ||
            this.loadIfExists(adapterPath, moduleStack, null);

        // if still no adapter found, then there is an issue
        if (!Adapter) {
            throw new Error('ServiceFactory could not find adapter ' + adapterName +
            ' paths ' + overridePath + ' and ' + adapterPath);
        }

        return new Adapter(resource);
    }
551941
def GetAdaptersAddresses(AF=AF_UNSPEC):
    """"""
    # We get the size first
    size = ULONG()
    flags = GAA_FLAG_INCLUDE_PREFIX
    res = _GetAdaptersAddresses(AF, flags,
                                None, None,
                                byref(size))
    if res != 0x6f:  # BUFFER OVERFLOW -> populate size
        raise RuntimeError("Error getting structure length (%d)" % res)
    # Now let's build our buffer
    pointer_type = POINTER(IP_ADAPTER_ADDRESSES)
    buffer = create_string_buffer(size.value)
    AdapterAddresses = ctypes.cast(buffer, pointer_type)
    # And call GetAdaptersAddresses
    res = _GetAdaptersAddresses(AF, flags,
                                None, AdapterAddresses,
                                byref(size))
    if res != NO_ERROR:
        raise RuntimeError("Error retrieving table (%d)" % res)
    results = _resolve_list(AdapterAddresses)
    del(AdapterAddresses)
    return results
913049
public function setAdapter($adapterOrSqlObject)
    {
        if ($adapterOrSqlObject instanceof \Zend\Db\Sql\Sql) {
            $this->sqlObject = $adapterOrSqlObject;
        } elseif ($adapterOrSqlObject instanceof \Zend\Db\Adapter\Adapter) {
            $this->sqlObject = new \Zend\Db\Sql\Sql($adapterOrSqlObject);
        } else {
            throw new \InvalidArgumentException('Object of "Zend\Db\Sql\Sql" or "Zend\Db\Adapter\Adapter" needed.');
        }
    }
1348138
function AdapterJsRTCObjectFactory(logger) {

    Utils.checkArguments(arguments, 1);

    this.createIceServers = function (urls, username, password) {
        if (typeof(createIceServers) !== "undefined") {
            return createIceServers(urls, username, password);
        }
        else {
            logger.error("adapter.js not present or unsupported browser!");
            return null;
        }
    };

    this.createRTCSessionDescription = function (sessionDescriptionString) {
        if (typeof(RTCSessionDescription) !== "undefined") {
            return new RTCSessionDescription(sessionDescriptionString);
        }
        else {
            logger.error("adapter.js not present or unsupported browser!");
            return null;
        }
    };

    this.createRTCIceCandidate = function (rtcIceCandidateString) {
        if (typeof(RTCIceCandidate) !== "undefined") {
            return new RTCIceCandidate(rtcIceCandidateString);
        }
        else {
            logger.error("adapter.js not present or unsupported browser!");
            return null;
        }
    };

    this.createRTCPeerConnection = function (config) {
        if (typeof(RTCPeerConnection) !== "undefined") {
            return new RTCPeerConnection(config);
        }
        else {
            logger.error("adapter.js not present or unsupported browser!");
            return null;
        }
    };
}
241704
public final void lookupNameCompletionHints(
		SqlValidatorScope scope,
		List<String> names,
		SqlParserPos pos,
		Collection<SqlMoniker> hintList) {
		// Remove the last part of name - it is a dummy
		List<String> subNames = Util.skipLast(names);

		if (subNames.size() > 0) {
			// If there's a prefix, resolve it to a namespace.
			SqlValidatorNamespace ns = null;
			for (String name : subNames) {
				if (ns == null) {
					final SqlValidatorScope.ResolvedImpl resolved =
						new SqlValidatorScope.ResolvedImpl();
					final SqlNameMatcher nameMatcher = catalogReader.nameMatcher();
					scope.resolve(ImmutableList.of(name), nameMatcher, false, resolved);
					if (resolved.count() == 1) {
						ns = resolved.only().namespace;
					}
				} else {
					ns = ns.lookupChild(name);
				}
				if (ns == null) {
					break;
				}
			}
			if (ns != null) {
				RelDataType rowType = ns.getRowType();
				if (rowType.isStruct()) {
					for (RelDataTypeField field : rowType.getFieldList()) {
						hintList.add(
							new SqlMonikerImpl(
								field.getName(),
								SqlMonikerType.COLUMN));
					}
				}
			}

			// builtin function names are valid completion hints when the
			// identifier has only 1 name part
			findAllValidFunctionNames(names, this, hintList, pos);
		} else {
			// No prefix; use the children of the current scope (that is,
			// the aliases in the FROM clause)
			scope.findAliases(hintList);

			// If there's only one alias, add all child columns
			SelectScope selectScope =
				SqlValidatorUtil.getEnclosingSelectScope(scope);
			if ((selectScope != null)
				&& (selectScope.getChildren().size() == 1)) {
				RelDataType rowType =
					selectScope.getChildren().get(0).getRowType();
				for (RelDataTypeField field : rowType.getFieldList()) {
					hintList.add(
						new SqlMonikerImpl(
							field.getName(),
							SqlMonikerType.COLUMN));
				}
			}
		}

		findAllValidUdfNames(names, this, hintList);
	}
1068075
function loadAdapters() {
        var adapters = {};
        var adaptersDir = path.join(this.injector.rootDir, this.injector.servicesDir + '/adapters');

        if (!fs.existsSync(adaptersDir)) {
            return this.injector.adapters || {};
        }

        var me = this;
        var adapterNames = fs.readdirSync(adaptersDir);

        _.each(adapterNames, function (adapterName) {
            if (adapterName.substring(adapterName.length - 3) !== '.js') {  // only dirs, not js files
                var adapterImpl = me.injector.adapterMap[adapterName];
                adapterName = utils.getPascalCase(adapterImpl + '.' + adapterName + '.adapter');
                adapters[adapterName] = me.injector.loadModule(adapterName);
            }
        });

        // add the adapters that come from plugins to the list
        _.extend(adapters, this.injector.adapters);

        // return the adapters
        return adapters;
    }
1100760
function findAdapter(adapters, mediaType, method) {
  for (let i = 0; i < adapters.length; i += 1) {
    if (adapters[i].mediaTypes.indexOf(mediaType) !== -1 && adapters[i][method]) {
      return adapters[i];
    }
  }

  return null;
}
237495
def []=(name, value)
      @column_keys << name
      @attrs[to_key(name)] = value
      define_accessor(name) unless respond_to?(name)
    end
442318
def ar_layer(&blk)
      if !defined?(ActiveRecord)
        raise "ActiveRecord not available"
      end

      config = ActiveRecord::Base.connection.instance_variable_get("@config")
      params = {
        :dbname   => config[:database],
        :user     => config[:username],
        :host     => config[:host],
        :port     => config[:port],
        :password => config[:password]
      }

      conn = "PG:" + params.reject {|k,v| v.nil? }.map {|k,v| "#{k}=#{v}"}.join(' ')

      layer conn, &blk
    end
865742
protected function _checkAdapter()
    {
        $notDefined = !is_object($this->_adapter);
        $isAdapter = $this->_adapter instanceof AdapterInterface;

        if ($notDefined || !$isAdapter) {
            throw new InvalidArgumentException(
                "You need to set the database adapter for this schema loader."
            );
        }
    }
356677
function _connect($argHostname, $argUsername, $argPassword,$argDBorProvider, $argProvider= '')
	{
	// two modes
	//	-	if $argProvider is empty, we assume that $argDBorProvider holds provider -- this is for backward compat
	//	- 	if $argProvider is not empty, then $argDBorProvider holds db


		 if ($argProvider) {
		 	$argDatabasename = $argDBorProvider;
		 } else {
		 	$argDatabasename = '';
		 	if ($argDBorProvider) $argProvider = $argDBorProvider;
			else if (stripos($argHostname,'PROVIDER') === false) /* full conn string is not in $argHostname */
				$argProvider = 'MSDASQL';
		}


		try {
		$u = 'UID';
		$p = 'PWD';

		if (!empty($this->charPage))
			$dbc = new COM('ADODB.Connection',null,$this->charPage);
		else
			$dbc = new COM('ADODB.Connection');

		if (! $dbc) return false;

		/* special support if provider is mssql or access */
		if ($argProvider=='mssql') {
			$u = 'User Id';  //User parameter name for OLEDB
			$p = 'Password';
			$argProvider = "SQLOLEDB"; // SQL Server Provider

			// not yet
			//if ($argDatabasename) $argHostname .= ";Initial Catalog=$argDatabasename";

			//use trusted conection for SQL if username not specified
			if (!$argUsername) $argHostname .= ";Trusted_Connection=Yes";
		} else if ($argProvider=='access')
			$argProvider = "Microsoft.Jet.OLEDB.4.0"; // Microsoft Jet Provider

		if ($argProvider) $dbc->Provider = $argProvider;

		if ($argProvider) $argHostname = "PROVIDER=$argProvider;DRIVER={SQL Server};SERVER=$argHostname";


		if ($argDatabasename) $argHostname .= ";DATABASE=$argDatabasename";
		if ($argUsername) $argHostname .= ";$u=$argUsername";
		if ($argPassword)$argHostname .= ";$p=$argPassword";

		if ($this->debug) ADOConnection::outp( "Host=".$argHostname."<BR>\n version=$dbc->version");
		// @ added below for php 4.0.1 and earlier
		@$dbc->Open((string) $argHostname);

		$this->_connectionID = $dbc;

		$dbc->CursorLocation = $this->_cursor_location;
		return  $dbc->State > 0;
		} catch (exception $e) {
			if ($this->debug) echo "<pre>",$argHostname,"\n",$e,"</pre>\n";
		}

		return false;
	}
970826
public void rename_server(Database database, String srcServerName, String newServerName) throws DevFailed {

        if (!database.isAccess_checked()) checkAccess(database);

        DeviceData argIn = new DeviceData();
        argIn.insert(new String[]{srcServerName, newServerName});
        command_inout(database, "DbRenameServer", argIn);
    }
983464
private void overrideDatabaseTerminationToken(Map<Object, Object> props) {
        String overrideTermToken = null;
        String platformClassName = _dbMgr.getDatabasePlatformClassName(_pui);

        if (platformClassName != null) {
            overrideTermToken = platformTerminationToken.get(platformClassName);
        }

        if (overrideTermToken != null) {
            String existing = (String) props.get(PersistenceUnitProperties.TARGET_DATABASE_PROPERTIES);
            if (existing != null) {
                existing = existing + ",";
            } else {
                existing = "";
            }
            existing = (existing + "StoredProcedureTerminationToken=" + overrideTermToken);

            props.put(PersistenceUnitProperties.TARGET_DATABASE_PROPERTIES, existing);
        }
    }
624986
private void registerCustomArgumentResolvers() {
        getBean(RequestMappingHandlerAdapter.class).ifPresent(adapter -> {
            List<HandlerMethodArgumentResolver> argumentResolvers = adapter.getArgumentResolvers();

            if (argumentResolvers == null) {
                throw new IllegalStateException("No argument resolvers found in " + adapter +
                        ". It appears the handler was not initialized by the application context.");
            }

            // Add Sling-specific argument resolvers first
            List<HandlerMethodArgumentResolver> resolvers = new LinkedList<>();
            resolvers.add(new RequestPathInfoArgumentResolver());
            resolvers.add(new ResourceResolverArgumentResolver());
            resolvers.add(new ResourceParamArgumentResolver());

            // Subsequently add all existing argument resolvers (they are order-sensitive, ending with a catch-all resolver,
            // thus the custom resolvers have to go first)
            resolvers.addAll(argumentResolvers);
            adapter.setArgumentResolvers(resolvers);
        });
    }
1348314
function _connect($argHostname, $argUsername, $argPassword, $argDatabasename)
	{
		if (!function_exists('sqlsrv_connect')) return null;
		$connectionInfo = $this->connectionInfo;
		$connectionInfo["Database"]=$argDatabasename;
		$connectionInfo["UID"]=$argUsername;
		$connectionInfo["PWD"]=$argPassword;
		
		foreach ($this->connectionParameters as $parameter=>$value)
		    $connectionInfo[$parameter] = $value;
		
		if ($this->debug) ADOConnection::outp("<hr>connecting... hostname: $argHostname params: ".var_export($connectionInfo,true));
		//if ($this->debug) ADOConnection::outp("<hr>_connectionID before: ".serialize($this->_connectionID));
		if(!($this->_connectionID = sqlsrv_connect($argHostname,$connectionInfo))) {
			if ($this->debug) ADOConnection::outp( "<hr><b>errors</b>: ".print_r( sqlsrv_errors(), true));
			return false;
		}
		//if ($this->debug) ADOConnection::outp(" _connectionID after: ".serialize($this->_connectionID));
		//if ($this->debug) ADOConnection::outp("<hr>defined functions: <pre>".var_export(get_defined_functions(),true)."</pre>");
		return true;
	}