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

 Release :

    - xanadu

ft:locale :

    - de-DE

ft:publication_title :

    - Xanadu-API-Referenz

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ConnectionInfoProvider -- Scoped, Global

# ConnectionInfoProvider -- Scoped, Global {#ariaid-title1}

* Freigeben Version: Xanadu
* 
* Aktualisiert 1. August 2024
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 Minute Lesedauer

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

Sie können diese API in bereichsbezogenen Anwendungen oder im globalen Bereich verwenden. Verwenden Sie in bereichsbezogenen Skripts den Namespace-Identifier `sn_cc`.

Diese Funktion ruft Verbindungsinformationen ab, die durch den angegebenen Verbindungs-Alias identifiziert werden.  

    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(String 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 |
|-|-|
| ConnectionInfo | Informationen zur Verbindung. |
[Tabelle : 3. Ergebnisse]

{#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. |
| domainID | 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 |
|-|-|
| ConnectionInfo | Verbindungsinformationen. |
[Tabelle : 5. Ergebnisse]

{#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");


