How to set database session info

Jdev 9.0.3.3
My app manages user logins via a custom jaas implementation, but it connects to the db using a shared username/password. I capture the real username password of the logged in user in my app and want to add that info to some audit columns on my tables like Created_By, Updated_By, etc.
How do I pass in a value stored in my Java code to the db session so I can use that data in a trigger or whatever.
I understand there is a way to access the db session from the app mod, but I am unclear on how to do this.
TIA

Jdev 9.0.3.3
My app manages user logins via a custom jaas implementation, but it connects to the db using a shared username/password. I capture the real username password of the logged in user in my app and want to add that info to some audit columns on my tables like Created_By, Updated_By, etc.
How do I pass in a value stored in my Java code to the db session so I can use that data in a trigger or whatever.
I understand there is a way to access the db session from the app mod, but I am unclear on how to do this.
TIA

Similar Messages

  • How to set Database Logon Info, if allowDatabaseLogonPrompting="false"

    Hey,
    Here is the Version Details -
    Crystal report X1 R1
    Sql Server 2005
    Tomcat 5.5.27
    Question -
    I am using jsf viewer to dispaly report in my web project. We don't want to prompt for database logon information before showing the report to teh front user. I have seen few sample jsp code which creates the crystalreportviewer object and set the connectioninfo details and calls the processhttprequest method to render the report. I have tried the same approach and it works for us.
    But our requirement is to just use the jsf tags. Is there a way to pass the database credentials to the jsp without prompting for Logon Information or using the java code to populate the connectioninfo in crystalreportviewer instance.
    Here is the jsp file -
    <%@ taglib uri="/crystal-tags-reportviewer.tld" prefix="crviewer" %>
    <crviewer:viewer displayGroupTree="false" viewerName="CrystalViewer"
    reportSourceType="reportingComponent"
    displayGroupTree="false"       
            displayToolbarExportButton="true"
            displayToolbarPrintButton="true"
            displayToolbarRefreshButton="true"
            displayToolbarToggleTreeButton="false"
            displayToolbarCrystalLogo="true"
    top="100"
    left="200"
    reportSourceVar="#{Report.reportSource}"
    isOwnPage="true"
    displayGroupTree="false"
    allowDatabaseLogonPrompting="false">
    <crviewer:report reportName="Report.rpt">
         <crviewer:partsViewer viewerName="CrystalViewer"
              reportSourceType="reportingComponent"
              title="Fill to Fill Report"
              numberOfRecords="10"
              showHeadings="true"
              showPageNavigationLinks="true"
              allowParameterPrompting="false"
              reportSourceVar="#{Report.reportSource}"/>
    </crviewer:report>
    </crviewer:viewer>
    I am trying to run this and it shows an error page with information Database Login Error.
    I have created the report using JDBC/JNDI database connection with trusted authentication = false.
    The Sql Server 2005 error log shows -
    Error: 18456, Severity: 14, State: 5.
    Logon       Login failed for user ''. [CLIENT: <named pipe>]
    Any help will really be appreciated.
    Thanks
    Bonyshree

    Yes within the report designer i am able to refresh the report and open and close the report without getting prompted. I am not changing any database properties at runtime and using the jar files which come with CR Release 2.
    All i am doing is to export the report in pdf format. Here is the code :
    ReportExportControl exportControl = new ReportExportControl();
    ExportOptions exportOptions = new ExportOptions();
    PDFExportFormatOptions  pdfOptions = new PDFExportFormatOptions();
    exportOptions.setExportFormatType(ReportExportFormat.PDF);                 
    exportOptions.setFormatOptions(pdfOptions);     
    exportControl.setExportOptions(exportOptions);
    exportControl.setExportAsAttachment(false);     
    exportControl.setReportSource(this.wrapper.getReportSource());
    exportControl.setName(this.wrapper.getReportName());
    exportControl.setEnableLogonPrompt(false);
    //Pass Fields object to ReportExportControl
    exportControl.setParameterFields(this.wrapper.getFields());
    //Export only works if i pass the connections object with connectioninfo object populated with username and password.
    //We want to run the report using trusted authentication i.e. we don't want to pass username and password.
    exportControl.setDatabaseLogonInfos(connections);               
    if(to_refresh)
      exportControl.refresh();
    If i don't provide the connectioninfo object with proper username and password to run the report inside the java class, it try's to logon to database using username = 'userid'. I think it picks it from the JDBC Connection String created while creating database connection for the report in the designer.
    Here is the jdbc connection string for the JDBC/JNDI connection created inside the report designer:
    !net.sourceforge.jtds.jdbc.Driver!jdbc:jtds:sqlserver://localhost:1433/customer;namedPipe=true!user=!password=.
    Is there a way to get pass this problem??? Is there a way to force the connection from the java class to use trusted authetication??? Can we change the connection string to replace the userid with empty string to force trusted authetication???
    Any help will be really appreciated.
    Regards
    Bonyshree

  • How to set a session variable

    Hi,
    I would like to know how to set a session variable for the following purpose.
    At the top of my application I have a "Welcome <username>" I'd like it instead to have "Welcome <firstname> <lastname>".
    So the concept would be after the user logs in succesfully this session variable is dynamically set so it can be displayed.

    Hi Scott,
    I realize that I can set items etc in pages. The case I'm referring to is a reference in a template. My template has a "Welcome <user name>" ... so the code looks like "Welcome &APP_USER." Anyway to make it say "Welcome first_name last_name" in the template? Note I'll have to get the first/last names from a query
    Thanks,
    Marty

  • How to set the session using onClick event?

    Dear All,
    I have a link, which once the user click on it, I want to set the session.
    <a href="link.jsp" > Link </a>How to set the session? Where should I put <%session1.setAttribute ("test", "1234"); %>?
    Any idea?
    Thanks

    when u click on Link
    the control goes to link.jsp/.
    and in this page u can write the session related code.

  • How to set database credentials to form?

    Hi All,
    I'm newbie em Forms. I'm facing a situation and I don't know how to solve it. I run a forms application in a giver browser and I'm always asked to type database credentials in order to connect to this database. In development time there's no problem, however, general users cannot have database user and password to be able to access the form.
    Is there any way to set database credentials (user, password, database) in order to user not being asked to provide these info ?
    thanks a lot

    Hi,
    Plz configure formsweb.cfg file in order to achieve this. Set the parameter 'userid=<YourDatabaseCredential>'.
    e.g. userid=scott/tiger@orcl
    thanks & best regards,
    Qasim Javaid Malik

  • How to set database location for stored procedure

    Post Author: Pavel
    CA Forum: Data Connectivity and SQL
    I've already found out that setting location is not only my problem, but I can't understand the correct decision. We using CR to create reports, accessing the data in MSSQL by ODBC.
    Previously (up to version 8) I set location directly, editing the "Table" field in "Set Location" form. Command after report creation was:
    Proc(DBNAME.dbo.PROCEDURE_NAME;1)
    I erased "DBNAME.dbo.", so the correct command was
    Proc(PROCEDURE_NAME;1)
    After that, the report can run on any database name, any ODBC datasource with any owner name of procedure.
    Now we had to upgdate to CR 11 Developer Edition.
    Here I can't erase database location. But when I change database location to ODBC datasource for another database, the properties of stored procedure "Catalog" and "Owner" remain the same as they initiated when report was created! So, when report runs, it call
    exec OLD_DB_NAME.dbo.PROCEURE_NAME;1 ....
    So, the report doesn't work on customer database, because it has different name.
    How can I erase any database location in the report?We run reports using API from Gupta Team Developer applications, may be it is possible to set database location by API before running report?
    Plese help, any tips are usefull.

    Post Author: Pavel
    CA Forum: Data Connectivity and SQL
    When I set location to another database (i.e. another ODBC datasource) by clicking Update button, "Catalog" property is not changing! It remains unaltered. I had to remove procedure from report and then add procedure from another database, so there was a lot of formatting fileds after that.
    This is not a right decision. I didn't solved current problem, I only temporary patched it.
    The correct desision is to set location programmatically from application.But function PEGetNthTableLocation returns empty strings in CR11, or I incorectly declared this function (from CR8.5):
    BOOL CRPE_API PEGetNthTableLocation ( short printJob,  //handle to print job short tableN,  //number of table struct PETableLocation FAR *location     //structure pointer);typedef struct PETableLocation {    WORD StructSize;    char Location &#91;PE_TABLE_LOCATION_LEN&#93;; //256    char SubLocation&#91;PE_TABLE_LOCATION_LEN&#93;; //256    char ConnectBuffer&#91;PE_CONNECTION_BUFFER_LEN&#93;; //512} PETableLocation;

  • How to Identify database sessions used by forms sso user sessions?

    Hi:
    When using forms with SSO, all database sessions are opened by the same OSUSER (usually oracle), from the same machine (usually the forms server) and by the same program (usually [email protected] [TNS V1-V3]).
    I need a way to identify the database session (v$session) that is beeing used by a specific SSO user. By using SSO, we say implicitly that all users using that SSO resource will be connect to the database by a specific database user.
    So, what can I do to identify the database session that a specific forms user is using ?
    Thanks
    Joao Oliveira

    You could try something like the following in a when new form instance trigger:
    declare
    authenticated_username varchar2(30);
    begin
    authenticated_username := get_application_property(`sso_userid');
    DBMS_APPLICATION_INFO.SET_CLIENT_INFO (
    client_info IN VARCHAR2);
    end;
    This will store the sso userid in the client_info field of v$session.
    I hope this works for you.
    Randy McGregor

  • How to set database information runtime with delphi 2007 vcl11

    hi
    i'm trying to set database information runtime. I'm using mssql express 2005 and doing the following to set database information at runtime.
    for x  := 1 to crpe1.Tables.Count do
    begin
      crpe1.LogOnInfo.Items[x].ServerName := server.text;
      crpe1.logoninfo.items[x].DatabaseName := database.text;
      crpe1.logoninfo.items[x].UserID:=username.text;
      crpe1.logoninfo.items[x].Password := pass.text;
    end;
    is above code correct to set the database information?
    Thanks in advance,
    Parv

    hi all,
    i resolved it somehow. thanks.
    Parv

  • How to set database location in the crystal report X1 from the Source code.

    Dear All,
    I am using Crystal report X1 for report generation.Now I am setting the database location manually in the crystal report. How can I Set the database location from the Source code.
    Awaiting for your reply.
    Thanks in advance.
    Regards,
    Rahaneef T

    Here's a routine that also searches for subreports to set the log on info. Simply remove that aprt to set the main report logon info:
    IDatabaseTablePtr pTable;
    //get first table
    pTable = m_Report->Database->Tables->GetItem(1) ;
    long lTableCount = m_Report->Database->Tables->Count;
    for( long lTable=1; lTable<=lTableCount; lTable++ )
         pTable = m_Report->Database->Tables->GetItem(lTable);
         pTable->ConnectionProperties->DeleteAll();
         pTable->ConnectionProperties->Add("DSN", "Name of your DSN");
         pTable->ConnectionProperties->Add("Database", "Demo");
         pTable->ConnectionProperties->Add("Password", "sa");
         pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    // Log on the tables of the subreports.
    long lSectionCount = m_Report->Sections->Count;
    for( long lSection=1; lSection<=lSectionCount; lSection++ )
         ISectionPtr pSection = m_Report->Sections->Item[lSection];
         long lSubreportCount = pSection->ReportObjects->Count;
         for( long lSubreport=1; lSubreport<=lSubreportCount; lSubreport++ )
              IReportObjectPtr pSubreportObject = pSection->ReportObjects->Item[lSubreport];
              CRObjectKind crObjectKind;
              pSubreportObject->get_Kind(&crObjectKind);
              if( crObjectKind == crSubreportObject )
                   ISubreportObjectPtr SubReportPtr = pSubreportObject;
                   IReportPtr pSubReport = SubReportPtr->OpenSubreport();
                   long lTableCount = pSubReport->Database->Tables->Count;
                   for( long lTable=1; lTable<=lTableCount; lTable++ )
                        pTable = m_Report->Database->Tables->GetItem(lTable);
                        pTable->ConnectionProperties->DeleteAll();
                        //pTable->ConnectionProperties->Add("DSN", "dwcb12003");
                        pTable->ConnectionProperties->Add("Database", "CrystalEport_DB");
                        pTable->ConnectionProperties->Add("Password", "sa");
                        pTable->ConnectionProperties->Add("User ID", "1Oem2000");
    If that doesn't work you need to tell us what is the error you are getting and paste in the code you are using.

  • How to pass database logon info to a Crystal Report in a subreport with different server name using VS C #

    Post Author: fabu1971
    CA Forum: .NET
    I could pass the database logon in Reports with subreports but the reports with subreports with different  server name I can not pass the logon information . Do you have any idea how I can do that to pass the database logon with different database or server name ?

    Post Author: quafto
    CA Forum: .NET
    You can use the Subreports collection of the ReportDocument object to access all the subreports in your main report. These are returned as ReportDocument objects. Once you have your subreport as a ReportDocument you can loop through your Tables collection and set the ConnectionProperties to your appropriate Server/Database. For example here is some pseudo code: ConnectionInfo boConnectionInfo = new ConnectionInfo();boConnectionInfo.ServerName = "serverName";boConnectionInfo.DatabaseName = "databaseName";boConnectionInfo.UserID = "username";boConnectionInfo.Password = "yourpassword"; foreach(ReportDocument boSubreport in mainReport.Subreports){    foreach(Table boTable in boSubreport.Database.Tables)    {        TableLogOnInfo boTableLogOnInfo = boTable.LogOnInfo;          boTableLogOnInfo.ConnectionInfo = boConnectionInfo;          boTable.ApplyLogOnInfo(boTableLogOnInfo);          boTable.Location = "newtablelocation";     }}

  • Urgent!! How to publish a session Info Object once and pass it to sevaral forms

    Hi , I am using JDev 3.1. I have this problem when i create several forms in Jdev, where the wizard adds a sessionInfo object for each form. It also publishes them on the Infobus every time the form is called.I tried to use 1 marster sessionInfo Object from a marster form publish it there and then pass it to the other forms, but then the rowsets don't work propally. I f any one has any ideas please post as soon as possible.

    We do have a FAQ, and the topic is part of the FAQ. Unfortunately, it seems that the FAQ is not yet available on OTN. In the meantime, I'll post some of the content here which may be useful:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    Q
    How do I share database information across multiple Frames?
    A
    This describes using a SDI with multiple frames that share common database information (for example, a master-detail application
    based on Dept-Emp where Dept information is dispayed in one frame, and Emp in another). For help in constructing an MDI
    application, please refer to the JDeveloper documentation.
    1.Create an empty project
    2.Add a class to this project (this class will contain the SessionInfo, RowSetInfo, AttributeInfo)
    3.Switch to Design mode for this class, and create the SessionInfo and RowSetInfos for your application by selecting the
    appropriate object from the Component Palette, then clicking in the Structure Pane.
    4.Set the properties of these objects as normal.
    5.Create an Application with an empty Frame
    6.In design mode, drop the desired controls into the Frame.
    7.You can set all the properties for these controls as usual except for the properties that bind the control to a datasource. To bind
    the controls to a datasource, switch to Source mode and add the appropriate code, for example:
    textFieldControl1.setDataItemName("infobus:/oracle/sessionInfo1/rowSetInfo1/Deptno");
    8.Repeat steps 6 and 7 for the second Frame.
    9.Modify the Application to instantiate the class that contains the database information, and optionally to display the second
    Frame (you may want to use a button on Frame1 that shows Frame2 instead).
    Note that if you wish to access the methods of the database information objects programmatically, you may need to make the objects
    public static.
    <HR></BLOCKQUOTE>
    Also in regards to Ali's comment that executing all these queries when the app starts, you may be interested in the following:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    Q
    How do I delay the execution of one or more queries?
    A
    By default, all queries being used by RowSetInfos in your application are executed when SessionInfo.PublishSession() is invoked.
    There are two methods to potentially improve the performance of your DAC application if your queries return a large number of
    rows.
    1) As a workaround, you can dynamically alter the Where clause of your queries so that fewer rows (or no rows) are retrieved
    initially. For example, include the condition 1=2 in the Where clause. Then, based on some interaction from the user, you can set a
    "real" where clause condition. For information on dynamically altering the Where clause, see the appropriate FAQ.
    2) A slighter cleaner method is to delay the association and subsequent publishing of the RowSetInfo until AFTER
    SessionInfo.publishSession() is invoked. The following illustrates the order in which the key steps would be performed:
    1.define the all RowSetInfo objects and their attributes
    2.parent any RowSetInfo whose queries should be executed immediately to the SessionInfo object
    3.publish the SessionInfo
    4.parent any RowSetInfo objects whose queries should be delayed to the SessionInfo object
    5.when appropriate, publish the RowSetInfo using RowSetInfo.publishRowSet(true)
    <HR></BLOCKQUOTE>
    And, finally, the above makes reference to a FAQ for how to dynamically set the where clause:
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>
    Q
    How do I dynamically alter the Where clause of a RowSet?
    A
    There are two ways to accomplish this task. You can either call the setWhereClauseCondition on the RowSet, or you can use bind
    variables. Both of the samples below assume a TextField named textSearch in which the user has entered a search value.
    void buttonSearch_actionPerformed(ActionEvent e) {
    // Two ways of "refreshing" the RowSet with condition specified by user
    // Note that both samples use AttributeInfo.getColumnName() to get the appropriate
    // format of the column name which differs depending on whether the VO uses "Expert mode"
    // Example using dynamically created condition
    rowSetInfo1.setQueryCondition(NamerowSetInfo1.getColumnName() + " LIKE '" + textSearch.getText() + "%'");
    // Example using bind variable in condition (Note that the VO and its associated views must use ? style parameters)
    rowSetInfo1.setQueryCondition(NamerowSetInfo1.getColumnName() + " LIKE ?");
    rowSetInfo1.setQueryConditionParams(new Object[] {textSearch.getText() + "%"});
    // Execute the query in either case...
    rowSetInfo1.executeQuery();
    <HR></BLOCKQUOTE>
    I hope this helps!!!
    -- Brian
    null

  • How to set v$session.program ?

    Hi,
    I would like to set the v$session.program value to audit this after logon.
    In sqlplus I can see some program entries : plsqldev.exe, sqlplusw.exe, oem etc
    but I can not find the program entry for Forms & Reports 6i.
    How can I set this v$session.program value ?
    Many thanks and regards,
    Friedhold

    You cannot set the program; it is automatically filled with the OS executable that has created the session.
    If I enter Forms Builder and connect, then I see "ifbld90.exe" in the program column.
    Regards,
    Rob.
    Edited by: Rob van Wijk on 28-aug-2009 13:05
    Note that I was unaware of the information in Mohan Nair's referred thread.
    Here is a nice article: http://www.integrigy.com/security-resources/analysis/Integrigy_Spoofing_Oracle_Session_Information.pdf
    Quote: +"The program name is supplied directly by the client and can be set to any value by an attacker. The program value is set during the session initialization. Using the Oracle JDBC driver, the value can be set prior to the connection initialization. With the Oracle OCI driver, simply renaming the “exe” file will allow you to manipulate the program name."+

  • Web Dynpro - How to set and get info from Component Controller

    Hi Gurus!!!
    Im having some problems getting and setting info in component controller of my Web Dynpro.
    I can't see the difference between View Context and Global Context.
    How can i create a Global Context Between two views?
    Thanks!
    Regards.
    Polakinho.-

    hii
    difference between view context and global context is we can use the same component controller for all the views in the same application.but when when we create node in view context then it will be available for that view only not for any other view...so if we want to use the same node for all the views we need to create that view in the component controller.so it will become global for that application.
    for using global node you need to map that context in view controller.for that you need to go to that view then click on context tab and drag and drop node from component controller.so it will be available for that view.i hope it helps you.
    regards
    twinkal

  • Internationalization: How to set the session locale manually

    Hello,
    one more question from me.
    So I have my Web Dynpro application and it gets the current language either from the user profile or the browser settings, which is fine. I can switch what String or image to display with a "getLocale()" call if neccessary, but can I also SET the locale? I want to be able to change the language for internationalization, f.ex. a German user should be able to view the page in English if he chooses to do so. Is there a way to accomplish this and if yes, how?
    Thank you,
    Lukas.

    Hi,
    you can set the Locale. means after getting the default you can overwrite this with the desire one.
    But,your application is going to reside in the portal and in portal one Personalize link is present at the MasHead, in that User Profile link is present where user can reset few data regarding  the user profile and Language is one of them.
    So try to use that one,the scenario you are expalining for that no need to touch the code you can do directly from the personalize link coz this change is for time being.
    Hope this may help you.
    Deepak

  • How to set database name default for oracle discoverer 10g

    Hi
    Do you have idea of setting the database name default for oracle discoverer 10g

    I mean to say while login to discoverer 10g, it will ask for following options. In this Database should select the database name by default instead of any value
              User Name
              Password
              Database
              End User Layer

Maybe you are looking for

  • Accessing itunes store

    "Accessing ITunes Store" is hanging -- does anyone know of itunes problem?

  • Java.io.FilePermission

    I am baffled by a security.AccessControlException that I get when I try to start an RMI server. The server sets an RMISecurityManager(), then creates an engine that extends UnicastRemoteObject and attempts to bind it (on localhost) with Naming.rebind

  • Adobe Acrobat Pro XI Shutting Down

    I have downloaded Adobe Acrobat XI Pro, it shuts down and sends a report to Apple.  I have tried uninstalling and reinstalling the program but it keeps shutting down every few minutes.  Any suggestions?

  • Importing photos from old iphoto library

    i created a new library in iphoto (iphoto library 02) and would like to import specific photos (events) from my old iphoto library (iphoto library 01) into the new. I can import all, but that is not what I want. I want to be able to pick and choose p

  • Dimension or fact value

    Scenario: Got two dimension (time and organization) linked to a fact table with sickniss facts by persons. Now i want to add the info 'age class' (like 10-20 year, 21 -30 year.... ) Where to add the new info? Into the fact table or crate a new dimens