---
sourceDocument: Référence API Brésil
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/fr-FR/api-reference

 Release :

    - brazil

ft:locale :

    - fr-FR

ft:publication_title :

    - Référence API Brésil

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# ConnectionInfoProvider : incluse dans le périmètre, globale

# ConnectionInfoProvider : incluse dans le périmètre, globale {#ariaid-title1}

Rversion finale: Brazil  
Mis à jour 10 sept. 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 1 minute de lecture  
L'API ConnectionInfoProvider fournit des méthodes pour sélectionner des informations de connexion via l'alias de connexion.

Vous pouvez utiliser cette API dans des applications incluses dans le périmètre ou dans le périmètre global. Dans les scripts à portée, utilisez l'identificateur `d'espace` de noms sn_cc.

Cette fonction récupère les informations de connexion identifiées par l'alias de connexion donné.  

    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}

Sélectionne les informations de connexion via l'alias de connexion.
{#CIP-get-connection-infoprovider__table_afx_pp2_qbb__entry__3}

| Nom | Type | Description |
|-|-|-|
| Aucune |   |   |
[Tableau 1. Paramètres]

{#CIP-get-connection-infoprovider__table_afx_pp2_qbb}

## ConnectionInfoProvider : getConnectionInfo(aliasID de chaîne) {#ariaid-title3}

Récupère un objet ConnectionInfo identifié par l'aliasID donné dans le domaine actuel.
{#CIP-getConnectionInfo_S__table_xxn_xq2_qbb__entry__3}

| Nom | Type | Description |
|-|-|-|
| aliasID | Chaîne | Sys_id d'un alias de connexion. |
[Tableau 2. Paramètres]

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

| Type | Description |
|-|-|
| InfoConnexion | Informations sur la connexion. |
[Tableau 3. Renvoie]

{#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(aliasID de chaîne, domainID de chaîne) {#ariaid-title4}

Récupère un objet ConnectionInfo identifié par l'aliasID donné pour un domaine spécifique.
{#CIP-getConnectionInfoByDomain_S_S__table_xxn_xq2_qbb__entry__3}

| Nom | Type | Description |
|-|-|-|
| aliasID | Chaîne | Sys_id d'un alias de connexion. |
| domainID | Chaîne | Sys_id d'un domaine ou <kbd class="ph userinput">global</kbd>. |
[Tableau 4. Paramètres]

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

| Type | Description |
|-|-|
| InfoConnexion | Informations de connexion. |
[Tableau 5. Renvoie]

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


