---
sourceDocument: Yokohama-API-Referenz
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/de-DE/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - de-DE

ft:publication_title :

    - Yokohama-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ConnectionInfoProvider: Bereichsbezogen, global

# ConnectionInfoProvider: Bereichsbezogen, global {#ariaid-title1}

* Freigeben Version: Yokohama
* 
* Aktualisiert 30. Januar 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

Die ConnectionInfoProvider Die API bietet Methoden zum Auswählen von Verbindungsinformationen über den Verbindungsalias.

Sie können diese API in bereichsbezogenen Anwendungen oder innerhalb des globalen Bereichs verwenden. Verwenden Sie in bereichsbezogenen Skripts `sn_CC `Namespace-Bezeichner.

Diese Funktion ruft Verbindungsinformationen ab, die vom angegebenen Verbindungsalias identifiziert wurden.  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the current domain with the alias ID
    //     "6219afbf9f03320021dd7501942e70fc"
    var connectionInfo = provider.getConnectionInfo("6219afbf9f03320021dd7501942e70fc");
    if (connectionInfo != null) {
      // get data map
      var datamap = connectionInfo.getDataMap();
      gs.info(datamap["name"]);
      gs.info(datamap["connection_url"]);

      // get the same values using getAttribute
      gs.info(connectionInfo.getAttribute("name"));
      gs.info(connectionInfo.getAttribute("connection_url"));

      // get credential attributes
      gs.info(connectionInfo.getCredentialAttribute("user_name"));
      gs.info(connectionInfo.getCredentialAttribute("password")); 

      // get extended attributes
      var extendedAttributes = connectionInfo.getExtendedAttributes();  
      gs.info(extendedAttributes["name1"]);
     }

     // get a jdbc connection in the ACME domain with the alias ID
     //      "cd5923ff9f03320021dd7501942e70bb"
     connectionInfo = provider.getConnectionInfoByDomain("cd5923ff9f03320021dd7501942e70bb",
            "c90d4b084a362312013398f051272c0d");
     if (connectionInfo != null) {
       // get data map
       var datamap = connectionInfo.getDataMap();
       gs.info(datamap["name"]);
     }

## ConnectionInfoProvider -- ConnectionInfoProvider() {#ariaid-title2}

Wählt Verbindungsinformationen über den Verbindungsalias aus.
{#CIP-get-connection-infoprovider__table_afx_pp2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| Keine |   |   |
[Tabelle : 1. Parameter]

{#CIP-get-connection-infoprovider__table_afx_pp2_qbb}

## ConnectionInfoProvider -- getConnectionInfo(Zeichenfolge aliasID) {#ariaid-title3}

Ruft ein ConnectionInfo-Objekt ab, das durch die angegebene AliasID in der aktuellen Domäne identifiziert wird.
{#CIP-getConnectionInfo_S__table_xxn_xq2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| AliasID | Zeichenfolge | SYS_ID eines Verbindungsalias. |
[Tabelle : 2. Parameter]

{#CIP-getConnectionInfo_S__table_xxn_xq2_qbb} {#CIP-getConnectionInfo_S__table_yxn_xq2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Verbindungsinformationen | Informationen zur Verbindung. |
[Tabelle : 3. Rückgaben]

{#CIP-getConnectionInfo_S__table_yxn_xq2_qbb}  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the current domain with the alias ID
    //     "6219afbf9f03320021dd7501942e70fc"
    var connectionInfo = provider.getConnectionInfo("6219afbf9f03320021dd7501942e70fc");

## ConnectionInfoProvider -- getConnectionInfoByDomain (Zeichenfolge aliasID, Zeichenfolge domainID) {#ariaid-title4}

Ruft ein ConnectionInfo-Objekt ab, das durch die angegebene AliasID für eine bestimmte Domäne identifiziert wird.
{#CIP-getConnectionInfoByDomain_S_S__table_xxn_xq2_qbb__entry__3}

| Name | Typ | Beschreibung |
|-|-|-|
| AliasID | Zeichenfolge | SYS_ID eines Verbindungsalias. |
| Domäne-ID | Zeichenfolge | SYS_ID einer Domäne oder <kbd class="ph userinput">Global </kbd>. |
[Tabelle : 4. Parameter]

{#CIP-getConnectionInfoByDomain_S_S__table_xxn_xq2_qbb} {#CIP-getConnectionInfoByDomain_S_S__table_yxn_xq2_qbb__entry__2}

| Typ | Beschreibung |
|-|-|
| Verbindungsinformationen | Verbindungsinformationen. |
[Tabelle : 5. Rückgaben]

{#CIP-getConnectionInfoByDomain_S_S__table_yxn_xq2_qbb}  

    var provider = new sn_cc.ConnectionInfoProvider();

    // get a jdbc connection in the ACME domain with the alias ID
     //      "cd5923ff9f03320021dd7501942e70bb"
     connectionInfo = provider.getConnectionInfoByDomain("cd5923ff9f03320021dd7501942e70bb",
            "c90d4b084a362312013398f051272c0d");


