How to pass hardcoded user to ConnectionProperties ?

Hi,
How can i pass the hardcoded user to the ConnectionProperties constructor for JCA Connections.
ConnectionProperties prop = new ConnectionProperties(request.getLocale(), request.getUser());
i want to pass hardcoded user object in place of - request.getUser()
Thanks,
Raags

Hi Raags,
you obtain user objects from the user factory object. You have got multiple methods to obtain a user. See javadocs of <a href="https://help.sap.com/javadocs/NW04S/current/se/com/sap/security/api/IUserFactory.html">IUserFactory.</a>
Example:
IUserFactory userFactory = UMFactory.getUserFactory();
IUser myUser = userFactory.getUserByLogonID("MyUser");
Best regards,
Martin

Similar Messages

  • How to pass the USER variable to RPD in 11g?

    I am trying to figure out how to pass the USER variable to the RPD in 11g.
    In 10g, I had define an intializtion block to store the USER variable and pass it to a statement that has to be executed before the query is executed.
    We use the Oracle VPD technology that allows to restrict data access. This is the statement that has to be executed before a query can run.
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER(:USER))) from dual
    That is the 10g version and it works fine.
    In 11g, I tried to use
    select vpd_adwh.setclnvpdcontext_fnc('VALUEOF(NQ_SESSION.cuser)', UPPER('VALUEOF(NQ_SESSION.USER)')) from dual
    but this is not working.
    Any help?

    any ideas?

  • How to pass hidden user/passwd to report?

    Hi,
    Running reports in the Web is there a way to pass hidden user/passwd to report without using the map file?

    No, you either have to have the details in the map file or the URL itself. There's no other way to hide the username/password.
    Hope this helps.
    Regards,
    Jatinder
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by ehlamentavel:
    Hi,
    Running reports in the Web is there a way to pass hidden user/passwd to report without using the map file?<HR></BLOCKQUOTE>
    null

  • How to pass current user credential for PAPI service execution

    Hi All,
    As per my requirement I am using the SAP ME PAPI WS to start the SFC. I have used the SAPME PAPI Interface action block in ME within BLS and searched the service and operation also. Required input parameter mapping is also done and I have successfully executed the BLS and SFC is started in ME. In SAPME PAPI Interface action block I have used Credential alias which is standard configuration in MEINT for user MESYS.
    Now what I have seen is that, in ME the SFC is started by user MESYS. But I want to pass the user who is currently executing. Is there any way to pass the current user credential or session for executing the PAPI service. My final target is to use the BLS in IRPT through Xacute query.
    Thanks in Advance
    Chandan

    Hi Sergiy,
    It is only required for Sfc Start operation. It is a generic requirement for all PAPI WS. User ref is not available for all services. I have taken sfc Start operation as an example. But for  complete SFC operation there is no user ref. in Request structure. Then what would be our generic way to execute it through current user credential.
    Thanks
    Chandan

  • How to pass the User Group for a SQ00 Transaction iView

    Hello,
    To start off, I am relatively new to SAP technology in general.  I may be missing something obvious.
    I am trying to create an SAP Transaction iView in our EP Portal that will call the SQ00 transaction (start query) and run a particular query against our R/3 backend.  I set the Transaction Code to: SQ00, the application parameters to: RS38R-QNUM=<my query> and the OK Code to: SHOW and the System to the System alias for our R/3 system.
    My problem is that the query that I need to run is not in the default User Group that comes up by default.  So I get a screen that has the query field (RS38R-QNUM) correctly populated but the error that the query has not been created.  From that screen I can navigate to the correct User Group and then run query.  There does not seem to be a User Group field on the screen, you change it by accessing a different menu, so I do not know how to call the screen for a particular User Group.
    Is their an application parameter that I can initially pass to set the User Group?
    Thank you.

    And my lecturer is suck, every lectures she just read
    the slices and never explains why and how they are.
    (If ask her, she talks and talks rubbish and
    eventually I get nothing)Maybe you should drop the class and complain to the administration.

  • How to pass a "user defined" object to a thread?

    Hi...
    I have created an object say 'obj1' . I want to pass to a thread say 'T1' .
    The thread T1 implements the runnable class.
    I need to pass the "obj1" object to the T1 for it to be processed in the "run" method of T1.
    As far as I have seen there is no thread constructor in Java that accepts an object created by the user.
    My question is there any way to pass an object to a thread? and if so how can it be done?

    You can just add your own method to the class. Then call that method to pass the object to the thread before you call start on the thread.
    class MyThread implements Runnable
       public void run()
          userObj.whatever();
       public void addObj(Object obj)
          userObj = obj;
       Object userObj = null;
    // your code
    MyThread thread = new MyThread();
    thread.addObj(myObj);
    thread.start();As long as you don't call start before your pass the object to your thread, then you won't have a problem. Hope this helps.

  • How to pass hardcodded value to  current_user

    Hi All,
    I am using AUTHID CURRENT_USER in my pkg. In one case I am login in as a user "C" but I want to pass "CURRENT_USER" as a "B". How can I pass user name "B" even though my current user "C". Any ones help is much appreciated.
    Thanks

    ... but you still might not like it....
    SQL> conn b/b
    Connected.
    SQL> create table t1 (col1 number)
      2  /
    Table created.
    SQL> insert into t1 values (1);
    1 row created.
    SQL> grant select on t1 to a;
    Grant succeeded.
    SQL> conn a/a
    Connected.
    SQL> create or replace procedure p1
      2  authid current_user
      3  as
      4      n b.t1.col1%type;
      5  begin
      6      dbms_output.put_line('user = '||user);
      7      dbms_output.put_line('session_user = '||sys_context('userenv', 'session_user'));
      8      dbms_output.put_line('session_schema = '||sys_context('userenv', 'session_schema'));
      9      dbms_output.put_line('current_user = '||sys_context('userenv', 'current_user'));
    10      dbms_output.put_line('current_schema= '||sys_context('userenv', 'current_schema'));
    11      select col1 into n
    12      from b.t1
    13      where rownum = 1;
    14      dbms_output.put_line('col1='||to_char(n));
    15  end p1;
    16  /
    Procedure created.
    SQL> set serveroutput on
    SQL> exec p1
    user = A
    session_user = A
    session_schema = A
    current_user = A
    current_schema= A
    col1=1
    PL/SQL procedure successfully completed.
    SQL> grant execute on p1 to c
      2  /
    Grant succeeded.
    SQL> conn c/c
    Connected.
    SQL> exec a.p1
    BEGIN a.p1; END;
    ERROR at line 1:
    ORA-00942: table or view does not exist
    ORA-06512: at "A.P1", line 11
    ORA-06512: at line 1
    SQL> conn b/b
    Connected.
    SQL> grant select on t1 to c
      2  /
    Grant succeeded.
    SQL> conn c/c
    Connected.
    SQL> set serveroutput on
    SQL> exec a.p1
    user = C
    session_user = C
    session_schema = C
    current_user = C
    current_schema= C
    col1=1
    PL/SQL procedure successfully completed.
    SQL>Cheers, APC
    blog: http://radiofreetooting.blogspot.com

  • How to pass Proxy user dynamically in Toplink proxy authentication?

    Hi,
    I'm using Toplink Proxy Authentication with my ADF JSF application and want to pass the Proxy user dynamically to the preLogin(..) method of mySessionEventListener (Currently proxy user is hard coded).
    This is to make my application user as the Proxy user.
    I have tried to do this in two ways:
    1) In my Login screen Backing Bean, I retrieve the session as
    session = sessionFactory.acquireSession(); and set the application user in it as
    session.setProperty("proxyUser1", inputText1.getValue());
    But,
    session.getProperty("proxyUser1") returns null in the preLogin(..) method
    2) I add a loginUser property to the mySessionEventListener class and create a constructor to set it.
    Then I call the constructor from my Login Backing Bean as
    mySessionEventListener eventMgr = new mySessionEventListener(<proxy_user>);
    session.getEventManager().addListener( eventMgr );
    But, the loginUser property seeems to be transient and does not retain value when retrieved in preLogin(..) method.
    Please indicate if anything is wrong. Also, is there any other way to get this done?
    Thanks in advance.
    Vikas

    Hi Vikas,
    Probably your sessions.xml defines a ServerSession, and acquireSession method returns a ClientSession. ServerSession is the object that connects to the database, it may have any number of ClientSessions associated with it - all of them use connections provided by ServerSession's connection pools.
    So if you'd like to alter the serverSession before login, acquireSession is too late - it triggers login of the ServerSession and returns a ClientSession.
    To get the ServerSession before login:
    // the first param indicates that the session shouldn't be connected
    Session serverSession = sessionFactory.getSharedSession(false, false);Now you have a serverSession on which login hasn't been called yet.
    You can set the property into the session, or directly into its login.
    In fact you may choose to do whatever you wanted to do in preLogin right here - in this case no preLogin event would be required of course.
    Finally to get a ClientSession, call the same api did:
    // the first param indicates that the session shouldn't be connected
    Session clientSession = sessionFactory.getSession();On the first such call the ServerSession will be connected.
    Note that because all the ClientSessions will connect through the connections provided by the same ServerSession they will all use proxyUser1.
    If you are interested in using different proxy users for different ClientSessions http://www.oracle.com/technology/products/ias/toplink/doc/1013/main/_html/dblgcfg008.htm#BABDABCF lists several scenarios for that.
    Andrei

  • How to pass the user & pass  dynamically for  web services in composite.xml

    My project calling external secure web services.now i hardcode the username and password in composite.xml. i need to pass dynamically.Anyone can help me?

    OK, got it. Need to set the variable in the correct component in opmn.xml file.

  • How to pass a user defined table type to stored procedure?

    Hi,
    I am trying to call a stored procedure from Java. The store procedure has three IN parameter, 2 IN/OUT params and 3 OUT parameters. The two IN/OUT parameters are user defined objects. Can anyone tell me how to set these IN/OUT parameters in Java.
    Thanks

    It is database/driver specific so you need to use the specific functionality of the driver (not jdbc) to access it.

  • Issue in passing Oracle User Defined Types to PL SQL from Websphere Applica

    HI,
    I am facing an issue when trying to pass Oracle collection object(User Defined Types) from Java to PL SQL. The issue happens inside J2EE application which is running inside Websphere Application Server 6.x. My database is Oracle 10g and i am using ojdbc1.4.jar as thin driver.
    The issue is that when i pass the Oracle Object from java side, the attribute values of the collection objects at the Oracle PL SQL side is coming as empty. I have tried the same java code in a standalone application and it works fine. The issue happens only when the application is running inside WAS.
    Anybody has any idea how to pass Oracle User Defined Types from WAS 6.x server to Oracle PL SQL?

    Andy Bowes wrote:
    Hi
    I am using WebLogic 8.14 & Oracle 9i with thin JDBC driver.
    Our application needs to perform the same DB operation for every item in a Java Collection. I cannot acheive the required performance using the standard Prepare & Execute loop and so I am looking to push the whole collection to Oracle in a single invocation of a Stored Procedure and then loop on the database.
    Summary of Approach:
    In the Oracle database, we have defined a Object Type :
    CREATE OR REPLACE
    TYPE MYTYPE AS OBJECT
    TxnId VARCHAR2(40),
    Target VARCHAR2(20),
    Source VARCHAR2(20),
    Param1 VARCHAR2(2048),
    Param2 VARCHAR2(2048),
    Param3 VARCHAR2(2048),
    Param4 VARCHAR2(2048),
    Param5 VARCHAR2(2048),
    and we have defined a collection of these as:
    CREATE OR REPLACE
    TYPE MYTYPE_COLLECTION AS VARRAY (100) OF MYTYPE
    There is a stored procedure which takes one of these collections as an input parameter and I need to invoke these from within my code.
    I am having major problems when I attempt to get the ArrayDescriptor etc to allow me to create an Array to pass to the stored procedure. I think this is because the underlying Oracle connection is wrapped by WebLogic.
    Has anyone managed to pass an array to an Oracle Stored procedure on a pooled DB connection?
    Thanks
    AndyHi. Here's what I suggest: First please get the JDBC you want to work in a
    small standalone program that uses the Oracle thin driver directly. Once
    that works, show me the JDBC code, and I will see what translation if
    any is needed to make it work with WLS. Will your code be running in
    WebLogic, or in an external client talking to WebLogic?
    Also, have you tried the executeBatch() methods to see if you can
    get the performance you want via batches?
    Joe

  • How to pass submitted Data from a servlet to EJB Session Bean in JPA

    How to pass Data User submitted Data from a servlet to EJB Session Bean when using JPA :
    Hi ,
    I have a jsp page in which the user fills up the Data and submits it to the servlet :
    Inside servlets i am getting all the parameters and setting it to the Entity Class .
    Sample Entity class is shown below :
    @Entity
    public class Employee {
    @Id private int id;
    private String name;
    public Employee() {}
    public Employee(int id) { this.id = id; }
    public int getId() { return id; }
    public void setId(int id) { this.id = id; }
    public String getName() { return name; }
    public void setName(String name) { this.name = name; }
    }After calling setters of my Entity Class .
    I am using JNDI lookup to call my session Bean method and pass this Entity class to the session Bean to persist data
    Please let me know what will be the right approach :
    1. Passing parameters whole as a Entity Class
    that is
    public void insertData(Employee emp)
    }Or
    2. public void insertData(String Name , int ID)
    }

    they are both right as they both work. Easy huh?
    You might argue that if you have to set a lot of fields, use the entity as otherwise you get a method with a gigantic amount of parameters.

  • OSB db-adapter: how to pass a proxy user or something like this?

    Hello, on OSB with a Oracle db-adapter, I'd like to do some database updates. Usually the db-adapter is set up with a technical database user.
    But on database side, this way I don't know exactly which user has been updating my table because only the technical user will be inserted into "Created_by" Column
    (select USER from dual ==> technical user).
    Now I thougt about using Proxy Users. But there exists some other Problems:
    - every proxy user has to be initially created in the database
    - how can I pass proxy user and technical user from OSB to the database?
    (using JCA, JNDI and JDBC Data Sources)
    ... on JDBC datasources I can only specify hard coded userid/password (--> technical user)
    Any help would be appreciated. Maybe some good white papers or tutorial exists in the web, but I can't finde a good one.
    Thanks
    Best regards

    You can pass in the adapter header property "jca.db.ProxyUserName". That way you can specify a user for each invoke.
    I got confirmation that OSB supports setting these properties. The sample adapters-db-201-MovieImages on soasamples.samplecode.oracle.com > Adapters shows working with header properties but with Mediator.
    Thanks
    Steve

  • How to pass user name and password in openConnection method ?

    Hi, Exports,
              I am trying to post data from applet to another application which is
              protected by network password.
              How to pass user name and password when I use openConnection method? In java
              doc, this method looks like do not accept these two parameters.
              Thanks
              ----- my code in applet ---------
              URL url = new URL("http://127.0.0.1/xml/index.cfm");
              URLConnection connection = url.openConnection();
              connection.setDoInput(true);
              connection.setDoOutput(true);
              connection.setUseCaches(false);
              connection.setAllowUserInteraction(false);
              DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              dos.writeBytes("Content-Type:
              multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              dos.writeBytes("Host: "+host+":"+port+"\r\n");
              dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              dos.writeBytes("Connection: Keep-Alive\r\n\n");
              dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              on: form-data;name=\"xmlDoc\"\r\n\r\n");
              dos.writeBytes(buff.toString());
              dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              dos.close();
              

    you need to negotiate Authentication in ur applet code...
              For example:
              If u r using Form based auth u need to send Post a request with j_user_name &
              j_password to the action j_security_check. and when server returns back the
              cookie
              u need to hold it and pass that cookie to the each and every request made to the
              protected application.
              Basically u need to imitate the browser.
              regards
              aseem
              David wrote:
              > Hi, Exports,
              >
              > I am trying to post data from applet to another application which is
              > protected by network password.
              > How to pass user name and password when I use openConnection method? In java
              > doc, this method looks like do not accept these two parameters.
              >
              > Thanks
              >
              > ----- my code in applet ---------
              > URL url = new URL("http://127.0.0.1/xml/index.cfm");
              > URLConnection connection = url.openConnection();
              > connection.setDoInput(true);
              > connection.setDoOutput(true);
              > connection.setUseCaches(false);
              > connection.setAllowUserInteraction(false);
              > DataOutputStream dos = new DataOutputStream(connection.getOutputStream());
              > dos.writeBytes("POST " + path + " HTTP/1.0\r\n");
              > dos.writeBytes("Referer: http://127.0.0.1/XML/index.cfm\r\n");
              > dos.writeBytes("Content-Type:
              > multipart/form-data;boundary=---------------------------7d0b414b04\r\n");
              > dos.writeBytes("Host: "+host+":"+port+"\r\n");
              > dos.writeBytes("Content-Length:" + buff.length()+"\r\n");
              > dos.writeBytes("Connection: Keep-Alive\r\n\n");
              > dos.writeBytes("-----------------------------7d0b414b04\r\nContent-Dispositi
              > on: form-data;name=\"xmlDoc\"\r\n\r\n");
              > dos.writeBytes(buff.toString());
              > dos.writeBytes("\r\n-----------------------------7d0b414b04--\r\n");
              > dos.close();
              >
              > ------------------------------------------
              

  • How to pass user and password in workspace when open a bqy

    hello,
    how to pass user and password of workspace when refresh a bqy for a query in DB2.
    I don't know where to insert the properties in order to use user and password of workspace,
    I want to use user of login of workspace,
    I don't want to make to appear the mask of login newly when the user refresh the query.
    I don't want to set a default user and password
    thanks
    massimo

    Dear Friend,
    What you mean?
    1. Do you mean how to pass login page on workspace ?
    2. or Do you mean how you can use a connection file to connect to db that is hide from user?
    3. or You mean how to use user & password to login to doc on workspace
    Answer for 1:
    use link
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy?user=admin&pass=password
    Answer for 2:
    a) Upload or import connection file ( MyConn.oce ) to DB2 into workspace,
    b) for IR doc properties change file connection ( MYConn.oce )
    Answer for 2:
    use link without user & pass parameter
    http://HyperServer:45000/workspace/browse/get/MyFolder/MyIR.bqy <?user=admin&pass=password>
    regards
    siyavuş

Maybe you are looking for

  • Hyper-v 2012 r2 slow throughputs on network / live migrations

    Hi, maybe someone can point me in the right direction, I have 10 servers 5 Dell r210s and 5 Dell R320's, I have basically converted these servers to standalone hyper-v 2012 servers, so there is no clustering on any at the moment. Each server is confi

  • New iPad (3rd gen) keyboard doesn't slide back in

    My new iPad keyboard (i.e. the default virtual keyboard of iOS) when it comes up (slides up) it doesn't slide back in when the typing mode is no longer needed. E.g. when I swipe all the way to the left and reach the search screen, the keyboard pops u

  • Sales order stock to normal stock, Billing in each stage of production

    Dear experts, Business process: In our client will process the goods in 3 stages. Finished good of on process is raw material of another process and sales order based production is going on in my client. Each stage of production required to bill to t

  • Screen layout for FSV

    Hi, How to create the screen layout for the financial statement version? What is the T-code? Thanks Sridevi

  • Distnoted memory leak in Mavericks?

    I recently upgraded from Mountain Lion to Mavericks and have found that the distnoted process will continue to grow (I've seen it use as much as 1.8G of RAM).  Since I rarely reboot my MBP, this has become quite an issue for me.  Anyone else seeing t