Skip to Content
author's profile photo Former Member
Former Member

retrieving data from MDM using a simple JAVA program

Hi All,

I want to know how to access MDM from a simple JAVA program which is written in Netbeans.

I have all the credentials needed to access MDM server. But i dont understand how to access the data from JAVA.

I have the Basic idea of MDM.

please help me in this regard.

thanks in advance.

Add a comment
10|10000 characters needed characters exceeded

Related questions

3 Answers

  • Best Answer
    Posted on Jun 16, 2008 at 01:36 PM

    Hi,

    Might be this code will be usefull try out...

    String tag = "LOCALHOST";

    ConnectionPool connections = null;

    try {

    connections = ConnectionPoolFactory.getInstance(tag);

    } catch (ConnectionException e) {

    e.printStackTrace();

    return;

    }

    // specify the repository to use

    // alternatively, a repository identifier can be obtain from the GetMountedRepositoryListCommand

    String repositoryName = "TestRepos";

    String dbmsName = "LOCALHOST";

    RepositoryIdentifier reposId = new RepositoryIdentifier(repositoryName, dbmsName, DBMSType.MS_SQL);

    // create a repository session

    CreateRepositorySessionCommand sessionCommand = new CreateRepositorySessionCommand(connections);

    sessionCommand.setRepositoryIdentifier(reposId );

    try {

    sessionCommand.execute();

    } catch (CommandException e) {

    e.printStackTrace();

    return;

    }

    String sessionId = sessionCommand.getRepositorySession();

    // authenticate the repository session

    String userName = "Admin";

    String userPassword = "";

    AuthenticateRepositorySessionCommand authCommand = new AuthenticateRepositorySessionCommand(connections);

    authCommand.setSession(sessionId);

    authCommand.setUserName(userName);

    authCommand.setUserPassword(userPassword);

    try {

    authCommand.execute();

    } catch (CommandException e) {

    e.printStackTrace();

    return;

    }

    // retrieve the list of tables and pick the main table

    GetTableListCommand tableListCommand = new GetTableListCommand(connections);

    tableListCommand.setSession(sessionId);

    try {

    tableListCommand.execute();

    } catch (CommandException e) {

    e.printStackTrace();

    return;

    }

    TableProperties mainTable = null;

    TableProperties[] tables = tableListCommand.getTables();

    for (int i = 0; i < tables.length; i++) {

    if (tables.getType() == TableProperties.MAIN)

    mainTable = tables;

    }

    // retrieve the list of fields from the main table

    // this is useful for resolving conflicting field names the new field might create

    GetFieldListCommand getFieldListCommand = new GetFieldListCommand(connections);

    getFieldListCommand.setSession(sessionId);

    getFieldListCommand.setTableId(mainTable.getId());

    try {

    getFieldListCommand.execute();

    } catch (CommandException e) {

    e.printStackTrace();

    return;

    }

    Regards,

    Cherry.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 16, 2008 at 07:37 AM

    Hi

    http://help.sap.com/javadocs/MDM/SP06/overview-summary.html

    /people/bv.pillai/blog/2006/11/28/installing-mdmtech-add-on-and-configuring-the-mdm4a-mdm-for-abap-api

    check the above link .

    Regards ,

    venkat

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 16, 2008 at 10:02 AM

    Hi Ratna,

    Apart from the above given usefull links, try these out, they might be usefull

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/905b0e05-bfbc-2a10-1b9f-d6a7baf327b5

    /people/walter.kahn/blog/2005/10/27/mdm-55-api-tips-and-tricks--measurement-fields

    https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/2d18d355-0601-0010-fdbb-d8b143420f49

    and

    java-api

    Cheers,

    Cherry.

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.