How to Create a connection and User Seesion and Authentificate Session

Hi
    I would like that someone provide my the code to set a connection with MDM through the MDM Java APIS SP6 Patch2. I need to connect with the repository, and authentificate the User and the Password. Furthermore I would need the code to pick up events like add record and modified record. When a record is added or modified is neccesary to pick up the value of a lookup field in the main table to check that this value is a specific value in order to syndicate this record. That´s possible that someone provide this code to me.
thanks in advance.  If the reply is useful there will be rewards Points.

Hi,
Check this out
ConnectionAccessor simpleConnection=null;
RepositorySchema repSchema=null;
RepositoryIdentifier repIdentifier=null;
DBMSType dbmsType = DBMSType.MS_SQL;
String session=null;
String connection = "MDM_SERVER_PROD";
String repository  = "TEST_REP";
simpleConnection = SimpleConnectionFactory.getInstance(connection);
repIdentifier = new RepositoryIdentifier(repository, connection, dbmsType);
RegionProperties dataRegion = getRegion();
CreateUserSessionCommand createUSesCmd = new CreateUserSessionCommand(simpleConnection);
createUSesCmd.setDataRegion(dataRegion);
createUSesCmd.setRepositoryIdentifier(repIdentifier);
createUSesCmd.execute();
session = createUSesCmd.getUserSession();
AuthenticateUserSessionCommand authUSesCmd = new AuthenticateUserSessionCommand(simpleConnection);
authUSesCmd.setSession(session);
authUSesCmd.setUserName("Admin");
authUSesCmd.setUserPassword("pass123");
authUSesCmd.execute();
GetRepositorySchemaCommand getRepSchCmd = new GetRepositorySchemaCommand(simpleConnection);
getRepSchCmd.setSession(session);
getRepSchCmd.execute();
Just put all the execute statements within try catch block
Regards,
Jitesh Talreja

Similar Messages

  • How to create ODBC connection between Oracle 10g and MS SQL Server

    Hi,
    Can someone help us with the steps to create an ODBC connection between Oracle APPS using Oracle 10g database and MS SQL Server.
    Requirement is to extract the transactional data from MS SQL Server on a daily basis and dump it into Oracle tables for an interface to be run. Currently it is being done through Dataloader tool which we feel is causing the data issue with Arabic characters. We want to create the ODBC directly between Oracle and MS SQL Server and check if the data is being pulled correctly.
    The data is in sql server 2000 which has data in Arabic_CI_AS character set which is moved to Oracle 10.2.0.3 database with characterset AL32UTF8. The table data is moved to oracle using the dataloader 3.6 standard edition licensed version. We cannot change the character set of Sql Server 2000.
    Please help
    Thanks
    Shanil

    Hi,
    If you're trying to PULL data from SQLServer into an Oracle database, you wouldnt use Oracle ODBC driver for that, so you may want to post in the Heterogeneous Services forum instead:
    Heterogeneous Connectivity
    If you're trying to PUSH data from SQLServer into an Oracle database, you could use ODBC but most folks use OLEDB for that, and the following note on MOS should help:
    How to Create a Sql Server Linked Server With The Oracle Provider for OLE DB     (Doc ID 191368.1)
    As with any NLS related issue, the first thing to do is dump the codepoints of the data in the Oracle database to see if it is stored validly, rather than relying on what the data "looks like" from some tool or other. It's best to check a single row, with only a few characters in it if you can, and you can do that via
    SELECT DUMP(<columname>,1016) FROM <tablename> WHERE ...
    Hope it helps,
    Greg

  • How to create a connection between EP-Portal and BW system

    Hi friends ,
    Can you pl expalin me How ro connect EP to BW ,I have created an Iview in the portal to get some BW data using BSP application .How to assign Iview to system object ? and what are parameters i need to give in the system object .
    Thanks,
    Sunitha Reddy

    Probably better asked in the PORTAL forum. But anyways...
    Create iView for BI.
    Assign BI iView the ALIAS of your BI system (this assumes you created a BI system object previously and assigned it an alias)
    Just that easy.
    If you are on BI 7, then your BI might have it's own portal and you can create a federated portal network between BI and your portal. It works GREAT and is easy as cake.

  • How to create  DynPage based on user parameter and than implement it?

    Hello,
    I've written a Portal Application which contains a Portal Object which is a DynPage.
    I am using NWDS for development and NW 04 Patch 11 as the portal.
    This DynPage process something according to a hardcoded URL. I would like to transform this URL to a parameter which will be received from the user.
    Can someone please explain me the whole process with a simple example that includes:
    1. How to change the code/project to receive parameter from the user?
    2. How to change the iView configuration which is based on this PAR file to send the user parameter.
    3. Where the user should enter it's parameter once all done?
    Thank you.
    Roy

    Hi Roy,
         If i understand your question properly, then you should do the following. This will let you change the value globally for all the users as an iview parameter. If you edit the iview then you will see the property that you have added to portalapp.xml.
    1. Modify your portalapp.xml to accept iview personalization.
    <?xml version="1.0" encoding="utf-8"?>
    <application>
      <application-config>
        <property name="PrivateSharingReference" value="com.sap.portal.htmlb"/>
      </application-config>
      <components>
        <component name="links_tree">
          <component-config>
            <property name="ClassName" value="com.sap.sen.gcp.km.links.links_tree"/>
            <property name="SecurityZone" value="com.sap.sen.gcp.km.links/high_safety"/>
          </component-config>
          <component-profile>
            <b><property name="url" value="/documents"/></b>
          </component-profile>
        </component>
      </components>
      <services/>
    </application>
    3. The following code will get you the value of path.
    IPortalComponentRequest request = (IPortalComponentRequest) this.getRequest();
    IPortalComponentContext myContext = request.getComponentContext();
    IPortalComponentProfile profile = myContext.getProfile();
    <b>String url = profile.getProperty("url");</b>

  • How to create a new bundle of service and import it as normal user.

    Hi,
    I have created a service.
    Now am able to import and enable the service.
    I have placed my xml file under
    /var/svc/manifest/site
    The service name is
    <service
    name='site/newservice'
    I have imported the service as root user.
    <exec_method type='method' name='start' exec='/tmp/new/method/newservice start' timeout_seconds='30' />
    This service is not able to execute the operation which I have mentioned above. The following error is thrown in log file.
    Error: User 'root' is not the owner of '/tmp/new/method'
    So I tried to import the service as normal user, the following error is thrown.
    svccfg import /var/svc/manifest/site/newservice.xml
    svccfg: Could not create temporary service "TEMP/site/newservice" (permission de nied).
    svccfg: Import of /var/svc/manifest/site/newservice.xml failed. Progress:
    svccfg: Service "site/newservice": not reached.
    svccfg: Instance "newservice": not reached.
    Please help me to solve this issue.
    I thought instead of placing the service in default location,Why cant we create a new service of bundle and place the service there.
    Please help to solve this issue by suggesting some solution or how to create a new bundle of service and import it as normal user.
    Regards,
    Kalai

    kalaiyarasan_P wrote:
    Hi,
    I have created a service.
    Now am able to import and enable the service.
    I have placed my xml file under
    /var/svc/manifest/site
    The service name is
    <service
    name='site/newservice'
    I have imported the service as root user.Okay.
    <exec_method type='method' name='start' exec='/tmp/new/method/newservice start' timeout_seconds='30' />
    This service is not able to execute the operation which I have mentioned above. The following error is thrown in log file.
    Error: User 'root' is not the owner of '/tmp/new/method'By default, services run as the 'root' user. It's complaining that the method isn't also root.
    So I tried to import the service as normal user, the following error is thrown.You won't be able to do that easily. The user that does the import is almost always root. But wihin the manifest you could have it run as a different user.
    I thought instead of placing the service in default location,Why cant we create a new service of bundle and place the service there.
    Please help to solve this issue by suggesting some solution or how to create a new bundle of service and import it as normal user.You don't need to import this as a normal user, do you? You just want it to run as one, right?
    Darren

  • How to create a new admin user in oracle 9i?.

    Hi I am new to oracle. I want to set up a new database for my application.
    How to create a new admin user in oracle 9i?. I would like to have a new schema. where I can create tables for my application from scratch.

    If I understand your question correctly:
    You need to be connected to the database with the user SYS.
    open a command-line session and do the following to create an Oracle user with DBA option other than SYS.
    C:\>sqlplus /nolog
    SQL*Plus: Release 9.2.0.1.0 - Production on Fri Oct 14 08:46:13 2005
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    SQL> conn  /  as sysdba
    Connected.
    SQL>
    SQL> create user test identified by pass;
    User created.
    SQL> grant create session to test;
    Grant succeeded.
    SQL> alter user test account unlock;
    User altered.
    SQL> grant dba to test with admin option;
    Grant succeeded.
    SQL> conn test/pass
    Connected.
    SQL>
    SQL> sho user
    USER is "TEST"
    SQL>Now you have a user with username 'test' and password 'pass' with DBA role with Admin option
    Tony Garabedian
    From now on you can connect directly with SQL*Plus no need for comman-line. Just provide the username/password and you're logged in.
    Message was edited by:
    Tony Garabedian

  • How to create a connection pooling in Netbeans 6.0 using the oracle driver

    hi all,
    I am using Netbeans 6.0. Apache Tomcat 6.0.14 server, oracle 9i.
    I tried to create a connection pooling using tomcat web server.
    I have included the following code in context.xml and web.xml.
    CONTEXT.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <Context path="/network1">
    <Resource name="jdbc/myoracle"
    auth="Container"
    type="javax.sql.DataSource"
    username="scott"
    password="tiger"
    factory="BasicDataSourceFactory"
    driverClassName="oracle.jdbc.OracleDriver"
    url="jdbc:odbc:thin:@127.0.0.1:1521:mydb"
    maxActive="20"
    maxIdle="10"
    maxwait="-1"/>
    </Context>
    WEB.XML:
    <?xml version="1.0" encoding="UTF-8"?>
    <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
    <session-config>
    <session-timeout>
    30
    </session-timeout>
    </session-config>
    <welcome-file-list>
    <welcome-file>index.jsp</welcome-file>
    </welcome-file-list>
    <resource-ref>
    <description>Oracle Datasource example</description>
    <res-ref-name>jdbc/myoracle</res-ref-name>
    <res-type>javax.sql.DataSource</res-type>
    <res-auth>Container</res-auth>
    </resource-ref>
    </web-app>
    After that i have included the following JDBC driver's jar files in the $Catalina_Home/lib folder.
    classes 111.jar,
    classes 111_g.jar
    classes12.jar
    classes 12_g.jar
    classes12dms.jar
    classes12dms_g.jar
    nls_charset11.jar
    nls_charset12.jar
    ocrs12.jar
    ojdbc14.jar
    ojdbc14_g.jar
    Then i stop the tomcat web server and start it again.
    In jsp page i have included the following code:
    Context ctx=new InitialContext();
    Context envctx=(Context)ctx.lookup("java:comp:env");
    DataSource ds=(DataSource)envctx.lookup("jdbc/myoracle");
    Connection con=ds.getConnection(); ----->(In this line an error occured that Connection class cannot be found.)
    please help me how to create a connection pooling and rectify the error in conneciton.
    Thanks in advance

    Please refer
    http://www.netbeans.org/kb/60/web/customer-book.html

  • How to create a transport request with query and only with its structure.

    HI guru,
                how to create a transport request with query and only with its structure.transport request should not  include any other query items like ( variables, conditions...etc)
    thanks in advance.
    venkata

    Hi,
    Goto RSA1 and then Transport Connection -> In SAP Transports select Object Types-> Query Elements -> Then select Query->Give Technical name of the query and then select for transfer. In the right side you can choose the components which you wanted to transport.
    Regards,
    anil

  • How to test the connection between DSD backend and DSD connector

    Dear all,
    I am configuring the MDSD scenario .. and i want to insure that my customization is correct
    How to test the connection between DSD Backend and DSD connector ??

    Hi Viren,
    The problem is:
    We have a new BW system. The basis people asked me to check the connection between this BW system and the R/3. There is only one client for now(100). I have logged into 100 and tried executing RSA1 to check the connection, but it gave a message box saying "You can only work in Client 000". Then I have treid logging into 000(just to make sure) and tried executing RSA1. Even here I got a message saying "The SAP BW system must not be operated in client 000". Now, I am not sure of what is wrong in clien 100. I am not sure if I have to do some settings before I access RSA1 or any other BW transaction. Could you please help me in this.
    Also, I just checked the RFC destinations in BW. There is a destination created for our R/3 and I have noticed that they have given a remote UserID and password for remote login. I tried to check the Remote UserID in SU01 but there is no userID with that name. Could this be a problem?
    Thanks,
    RPK.

  • How to create Lookup field in user form in OIM 11g - Urgent

    Hi Experts,
    How to create Lookup field in User Form - OIM 11g.
    Pls. provide your support on priority.
    Regards
    Karan

    Thanks all for your suggestion.
    Our requirement, is we need to have a user defined field similar to how its there in "Organisation".
    For example we need to create an user defined field like "Service Holding" which holds different services say like Service 1, Service 2, Service 3 etc.
    Under each service there are multiple roles....
    Eg:
    Service 1 - Role 1, Role 2, Role 3
    Service 2 - Role 4, Role 5
    Service 3 - Role 6, Role 7, Role 8
    Is there a way to store multi-valued attribute in OIM UDF? If so, pls. guide us
    If its not possible we would need to create a Lookup field (something similar to Organization or Manager). User clicks on the button (lens button), which should invoke an API wherein he can select specific Roles and save in User. Eg. like Service 1 - Role 1#Service 2 # Role 5 and store in the backend database.
    Is this possible. Pls. guide.
    Regards,
    Karan

  • How to create database link between oracle9i database and oracle10g

    How to create database link between oracle9i database and oracle10g
    oracle9i database name "Prod" windows server 2003 ( 172.x.x.x)
    oracle10g database name "TEST" sun solaris 9 (165.x.x.x.x)
    Please help me on this

    For connections between 10.2 and 9.2 the 9.2 end MUST be at 9.2.0.4 or higher. Connections between 10.2 and 9.2.0.1, 9.2.0.2 or 9.2.0.3 are not supported.
    Connections between 10.2 and 9.0.1 was never been supported.
    Cheers !!!!
    Bhupinder

  • How to create db connection in IBM WebSphere IDE

    Hi,
    I am using IBM WebSpher 5.1.1. And i want to create a back end using ms-access. Can any one suggest me how to create the connection.
    While i used
    Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
    i am getting class not found. So i assumed that IBM doesnt provided such driver in the IDE.
    So can any one tell me the alternative to make a back end connection for Ms Access.
    Thanks,
    Girish.K

    Hi,
    I have just nw, got it succeeded.
    I just granted
    SQL> grant sysdba to sri;
    After that I am able to create connection with role 'sysdba'. Hope this post would be useful for someone who tries.
    Thanks for your reply.
    Regards,
    Sabarisri. N
    Edited by: Sabarisri Nagalingam on May 6, 2011 2:42 PM

  • How to create dynamic connection string with variables using ssis.

    Hello,
    Can anyone let me know on how to create dynamic connection string with variables using ssis?
    Any help would be appreciated.

    Hi vinay9738,
    According to your description, you want to connect multiple database from multiple servers using dynamic connection.
    If in this case, we can create a Table in our local database (whatever DB we want) and load all the connection strings.  We can use Execute SQL Task to query all the connection strings and store the result-set in a variable of object type in SSIS package.
    Then use ForEach Loop container to shred the content of the object variable and iterate through each of the connection strings. And then Place an Execute SQL task inside ForEach Loop container with the SQL statements we have to run in all the DB instances. 
    For more details, please refer to the following blog:
    http://sql-developers.blogspot.kr/2010/07/dynamic-database-connection-using-ssis.html
    If there are any other questions, please feel free to let me know.
    Regards,
    Katherine Xiong
    Katherine Xiong
    TechNet Community Support

  • How to create a login to users in PHP

    How to create a login for users to access their data,
    currently I can only see the first user everytime I login even with
    a different username. I know I need session stuff but don't know
    how to use, add or where to put them in.
    Thanks in advanced.

    I also am wrestling with the same problem. Session variables
    have not worked. I have determined that if the GET method is used,
    then the recordset of the users records are there. If the POST
    method is used, the recordset is blank. It appears to be something
    inherent in the Log In User behavior.
    I am trying to have a customer log in and then only see their
    particular inventory records. I do not want them be directed to a
    page with a listing of all the various customers and then select
    from that. Not suitable at all.
    If I find an answer, will let you know.
    Thanks and good luck,
    Dale :-)

  • How to create a new application user by my application?

    Hello,
    I want to give the user of my application the possibility to create a new application user if necessary. The creation of a new user should be realized in my application. I tried to find the answer in the apex user guide, but I haven't found it. Can somebody tell me how to create a new application user in the implemented application (one page in application for creating users for my application)?
    Thanks,
    Bettina

    Hello Bettina,
    You can do that using the API: www_flow_fnd_user_api.create_fnd_user. If you look at that procedure in SQL Dev (or TOAD or whatever you like), you can see an example and the description of the arguments.
    Greetings,
    Roel
    http://roelhartman.blogspot.com/
    http://www.bloggingaboutoracle.org/
    http://www.logica.com/

Maybe you are looking for

  • Weblogic 10.3.2 Icefaces 2.0 error for dataTable-sortable

    Hi All: I am using weblogic 10.3.2 and JSF 2.0, ICEFACES 2.0. I ran the example dataTable-sortable and I get the following error: jar files in the war file: commons-collections-2.1.1.jar commons-logging-1.0.4.jar icefaces-ace.jar icefaces-compat.jar

  • Multiple failures after updates Windows 7 64 bit Home Premium

        After loading the latest set of updates for my Windows 7 Home Premium 64 bit operating system and rebooting,   I am now experiencing a cascade of failures.  None of my network (wireless or ethernet) adapter or miniport drivers will load.  my fire

  • Maintianing multiple line items in main window  in scripts

    Hi folks,   i want to print multiple line items in main window of script for eg 50 line items then my main window should continue in second page also. how to maintain this. can u provide me sample code for this.. Thx in advance, Neelima.N

  • Java accessibility Bridge for windows

    I have installed Java Accessibility Bridge for windows but the screen reader in windows (Narrator) is not responding to my java application. On searching the internet, most of them mentioned about JAWS. So is it the only screen reader supporting Java

  • Bb 8530 3 months old won't start up! :(

    I downloaded some apps form bb app world, while texting it was soooo slow. so i took of the battery to see if that would fix my problem. well it caused an even bigger one. it never restarted completely. it goes through the whole hour glass thing then