Skip to content
Release: Australia · Updated: 2026-03-12 · Official documentation · View source

ConnectionInfoProvider - Scoped, Global

The ConnectionInfoProvider API provides methods to select connection information through the connection alias.

You can use this API in scoped applications or within the global scope. In scoped scripts, use the sn_cc namespace identifier.

This function retrieves connection information identified by the given connection alias.

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"]);
 }

Parent Topic:Server API reference

ConnectionInfoProvider - ConnectionInfoProvider()

Selects connection information through the connection alias.

NameTypeDescription
None  

ConnectionInfoProvider - getConnectionInfo(String aliasID)

Retrieves a ConnectionInfo object identified by the given aliasID in the current domain.

NameTypeDescription
aliasIDStringSys_id of a connection alias.
TypeDescription
ConnectionInfoInformation about the connection.
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(String aliasID, String domainID)

Retrieves a ConnectionInfo object identified by the given aliasID for a specific domain.

NameTypeDescription
aliasIDStringSys_id of a connection alias.
domainIDStringSys_id of a domain or global.
TypeDescription
ConnectionInfoConnection information.
var provider = new sn_cc.ConnectionInfoProvider();

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