Credentials in RunMyJobs are defacto standard for storing usernames and passwords in a safe way. Normally Credentials are directly linked to Jobs, but when marked as externally available, Credentials can also be read from RedwoodScript. Below on example to read the password of a Credential based on the JBDC-protocol, Endpoint and Real User:

      {
        Partition part = jcsSession.getPartitionByName("XYZ") ;
        Credential cred = jcsSession.getCredentialByCredentialProtocolEndpointRealUser​(part, 
                                                                                       jcsSession.getCredentialProtocolByName​(CredentialProtocol.JDBC),
                                                                                       "CredentialEndpoint", 
                                                                                       "CredentialRealUser") ;
      
        if ( cred == null)
        {
          jcsOut.println("Cannot read Credential") ;
        }
      
        jcsOut.println(cred.getRealUser() ) ;
        jcsOut.println(jcsSession.unprotectPassword(cred.getProtectedPassword()) ) ;
      
      }