informatica - Informatica 的 Java API

标签 informatica informatica-powercenter java

我正在尝试使用 Java API 与 informatica 连接。我正在努力在现场运行样本 C:\Program Files\Informatica\PowerCenter8.6.1\MappingSDK\samples\src\com\informatica\powercenter\sdk\mapfwk\samples 使用 com.informatica.powercenter.sdk.mapfwk.core.* 图书馆。

当我尝试运行 CreateConnectionSample.java(与存储库的简单连接)时,出现异常。

代码:

CachedRepositoryConnectionManager rpMgr = new CachedRepositoryConnectionManager(
            new PmrepRepositoryConnectionManager());
    Repository rep = new Repository();
    RepoProperties repoProp = new RepoProperties();

    repoProp.setProperty(RepoPropsConstant.PC_CLIENT_INSTALL_PATH,
            "C:\\Program Files\\Informatica\\PowerCenter8.6.1\\client\\bin");
    repoProp.setProperty(RepoPropsConstant.TARGET_REPO_NAME, "EDW_DEV_REPO");
    repoProp.setProperty(RepoPropsConstant.REPO_SERVER_DOMAIN_NAME, "DOM_GWM_DEV01");
    repoProp.setProperty(RepoPropsConstant.SECURITY_DOMAIN, "MSSB_INFA_DVLPR_DEV");
    repoProp.setProperty(RepoPropsConstant.ADMIN_USERNAME, "Username");
    repoProp.setProperty(RepoPropsConstant.ADMIN_PASSWORD, "Password");
    repoProp.setProperty(RepoPropsConstant.TARGET_FOLDER_NAME,"CORE");
    rep.setProperties(repoProp);
    rep.setRepositoryConnectionManager(rpMgr);
    ConnectionObject connObj = new ConnectionObject("Con", ConnectionAttributes.CONN_TYPE_RELATION);
    rep.createConnection(connObj);

我遇到异常

com.informatica.powercenter.sdk.mapfwk.exceptions.ConnectionFailedException: Failed to list connections in PowerCenter Repository

有人之前做过这个吗?谁能帮我设置 Java API。

最佳答案

嗯,这确实很旧了,希望您最终能够使用 SDK 进行连接。这是我最近编写的一些代码,用于获取连接并查询有关工作流程的一些内容。

    public static void main(String[] args) throws Exception {
    if(System.getenv("INFA_DOMAINS_FILE") == null)                  // make sure .infa file exists
        throw new Exception("INFA_DOMAINS_FILE path not set in environment variables.");

    Repository rep = new Repository();
    RepoConnectionInfo rci = new RepoConnectionInfo();
    rci.setRepoServerHost("your host DNS name");                    // set host URI     
    rci.setRepoServerPort("your host port number");                                 // host port
    rci.setRepoServerDomainName("your-domain-name");                    // repository domain name
    rci.setTargetRepoName("your-repository");                           // repository
    rci.setSecurityDomain("e-directory");                           // security type
    rci.setAdminUsername("your-credentials");                               // uid
    rci.setAdminPassword(getPassword());                            // pwd (stored in environment variable -- encoded so it's not cleartext)
    rci.setPmrepCacheFolder("c:\\users\\your-credentials\\Informatica\\");  // some cache folder that must be set  
    rci.setPcClientInstallPath("C:\\Informatica\\9.0.1\\clients\\PowerCenterClient\\client\\bin\\");
    rep.setRepoConnectionInfo(rci);                                                 // provide connection info to rep object
    RepositoryConnectionManager repmgr = new PmrepRepositoryConnectionManager();    // set up repository connection manager
    rep.setRepositoryConnectionManager(repmgr);                                     // tell repository to use connection manager

    System.out.println("Folders:");
    System.out.println("===========================================================================");
    List<Folder> folders = rep.getFolders();
    for(Folder f: folders) {  System.out.println(f);}
}

关于informatica - Informatica 的 Java API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17879919/

相关文章:

java - 如何将带有分隔符的文本文件读入数组并将数组元素存储在变量中?

java - 如何拒绝字符串和 double 输入?

linux - linux文件系统权限问题

performance - Informatica BDE 摄取作业运行 10 多个小时,终止并重新运行后 3 小时内完成

sql - 文件中的日期格式转换 'YYYYMMDD' TO 'MM/DD/YYYY'

java - 导入的java文件没有被调用

web-services - 如何在 Informatica Cloud Real time 中创建一个进程,该进程作为 Restful 服务公开并且可以从浏览器或其他地方调用?

data-warehouse - Informatica 将拒绝的行写入错误文件,如何避免?

utf-8 - 使用informatica将数据从平面文件加载到表中,同时具有英语和外语字符,如中文

oracle10g - 使用 Oracle 10g 配置 Informatica Repository [Oracle 未连接]