Execute query's from a bean

Hi all,
I have created a adf application with JDeveloper 11g.
All my pages have backing bean in where I can execute the query's that are on the pagedefenition. (trough the bindingscontainer)
Now I have created a session bean that not belongs to a page. How can I execute query's or get result from that session bean?
Thanks in advance.

Should de page of the page definition file already be openend once? I think else I can get a null pointer exception.In my experience, as long as you resolve such a valid definition inside your method (don't put it as an attribute), you will not get null pointer exception.
I am thinking of using the page definition of the login page, is that good?I can't say that it is good, but it will do no harm. The point here is that you should be consistent. In my case, I really created a page definition that is not related to any page. Sometimes I have validator classes which do need to access the data from the database, so I put all the method action definition in something named like "headless_userSessionPageDef".
Pagedef is called LoginPagePageDef in the package test1.view.pageDefs
Should the binding then look like BindingContainer bindings = (BindingContainer)JSFUtils.resolveExpression("#{test1.view.pageDefs.LoginPagePageDef}");One way to verify the name of your page definition by going thru the Expression Builder and expand the ADF Bindings> data. It would not be like what you described above.
Regards,
pino

Similar Messages

  • Unable to execute javascript from backing bean

    Hello experts,  I want to execute  javascript function from backing bean method.   
    In my .jsff  page,  I have added  the javascript as :
    <jsp:root  ..... >
    <af:resource type="javascript" >
              function fileDownloadJS() {
                                alert(" tesing js from backing bean");
        </af:resource>
    </jsp:root>
    in my backing bean method  :
    public void callJSfuntion(ActionEvent actionEvent) {
            RenderKit rk = FacesContext.getCurrentInstance().getRenderKit();
            ExtendedRenderKitService erks = (ExtendedRenderKitService) Service.getService(rk, ExtendedRenderKitService.class);
            erks.addScript(context, "fileDownloadJS();");
    I have table in my .jsff page,   inside table column,  I have command link  and when I click the link,   I am invoking bean method  :
    <af:table  ....>
        <af:column sortProperty="title" sortable="true"  
                           headerText="File name" width="250px" id="Title"
                           clientComponent="true">
                  <af:commandLink   id="cl1"    actionListener="#{MyBean.callJSfuntion}" clientComponent="true">  
                    <af:outputText value="#{row.title}" id="ot1"/> 
                  </af:commandLink>
         </af:column>
    .</table>
    But when  I  run my taskflow and  click on  the link inside the table column,    JS function is not invoked.
    Absolutely  no clue what  is the issue.
    Appreciate if you can  help me out to resolve this issue.   Thank you.

    For debugging purpose can you try :
    <script type="javascript" >
              function fileDownloadJS() {
                                alert(" tesing js from backing bean");
    </script>
    put it on top of the page and let me know what happens.
    If it doesn't work try writing the function itself in your addScript(context, script); to see if it works.

  • Calling execute query from WVI

    i wans to call the execute query function from the when-validate-item or in other words when i exit a text box i know calling execute_query from WVI is restricted but this is my requirement so pls tell me what is the way out for it... is there any other trigger in which i can do this or any other way out
    do reply
    thanx in advance
    amyt

    U will have to use combination of triggers
    depending upon your form.
    Key Next Item and WHen Mouse leave should be used

  • Web services and ADF 11g- get Result from backing bean

    I'm executing an action from backing bean (call Web service that returns complex data types)
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("unesiPonudu");
    Object result = operationBinding.execute();
    result is instance of oracle.adf.model.adapter.dataformat.XMLHandler$DataCollection but DataCollection is not accessible.
    How to get results from method?
    Tnx,
    Andreja

    Hi,
    there should be a result iterator in the Executables section which cotnains the result. If not, create it from the WS result entry in the DC palette. Once this iterator gets updated, you get the data from this iterator as it would be the case of a table accesses the WS
    Frank

  • 0ADHOC web template - How do I execute query views?

    Friends,
    I am using 0adhoc web template as default.  After executing a query I use drill downs and change output and then I click on save view and fill in all the required fields. I can find all those query views in BEx analyzer but not on web report. How do I execute query views from web report?
    Thanks in advance.
    Message was edited by:
            BJ P

    Thanks for your input. My users are using save view option on web report and they want to run previously saved views.  There should be a way otherwise why would they put save view option.
    Any suggestions??????

  • Not coming out from DB Tools Execute Query

    When I am removing my Ethernet connection and again connecting[for server client communication ], then sometimes the DB Tools Execute Query.vi function stucked inside and not coming outside from this function for infinite duration.
    How can I come out side this function when some network issue will come?
    When network connection is OK then that time there is no any problem, it actually occurs when network connection lost during the program ececution.

    It's hard to say what the problem is. One recomendation would be to drop usage of the database connectivity toolkit as it adds a lot of complexity and limits your options for troubleshooting problems. There is an alternative here. Read the discussion and download the drivers...
    Also, what kind of database are you connecting to?
    Mike...
    Certified Professional Instructor
    Certified LabVIEW Architect
    LabVIEW Champion
    "... after all, He's not a tame lion..."
    Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

  • Problem class important error while executing Query from favorites

    Hi Experts,
    1. I have tried execute the query from favorites it is showing the error message. " Problem class important"
        In the message text: logs showing error message [Attached the message screenshot].
    2. From "Query Designer" Execute [Ctrl+R] gives the error "500 Internal Server Error" [Attached the screenshot]
    3. Able to execute the reports from RRMX.
    No ST22 dumps. Can any one suggest about...how to rectify the errors.
    Thanks in advance...Surya

    Need tyo make sure the problem is with the query/workbook are general issue with all workbooks/query.
    1. Make sure the base query of work book is still executable. RRMX/RSRT.
    2. Execute the work book in Bex/Excel and look for definition of workbook; there might be some thing in the workbook referencing other than base query.
    3. If other workbook are also not working? need to check if other users have same issue.?
    Hope this will help to narrow the problem.
    Gopi

  • Execute Query from LOV

    Hi
    There is a Button that run LOV(Show LOV) ,
    how could make the Form Execute Query According to the user Selection from that LOV?
    Thanks

    hi
    Thank you Rahamath and thank you Joachim
    -Create non database item (Item_A). (As you told me Rahamath)
    -Used the LOV to return the value at non database item
    (Item_A) . (As you told me Rahamath)
    -Create Global variable (g_var). (as you told me Joachim)
    -At the trigger When_Button_Pressed I wrote :
    if show_lov (my_lov) then
    go_block('database_block');
    :global.g_var :=:block.Item_A;
         Execute_Query;
    End if;
    - Create Pre_Query Trigger at database block level
    (as you told me Joachim)
         if :global.g_var is not null then
    :id := :global.g_var,
    :global.g_var := null;
    end if ;
    so finally its work
    Thank you a lot for all of you
    bye
    mahmoud

  • Clearing Form when changing from Insert Mode to Enter/Execute Query

    Morning folks,
    I need some help or pointers with a form I am working on. At startup, the form is in Insert mode. I am using Oracle Forms 9i.
    Goal: Clear the form with NO_VALIDATE when User enters an ID in Insert mode and clicks on the Execute Query button(DEFAULT&SMARTBAR Inbuilt Menu)
    The user can do two things when they first open the screen.
    Option 1: Enter the STUDENT_ID and press Tab
    Option 2: Enter the STUDENT_ID and press the Execute Query button (Part of the DEFAULT&SMARTBAR Inbuilt Menu)
    There is a When-Validate-Item trigger on STUDENT_ID to check if the Student ID already exists in the database. If it does, it gives an Error message saying "Student ID found. Please Query the record or enter a new Student ID". This is fine with Option 1.
    The problem arises with Option 2. When I Enter a Student ID in Insert Mode and (thinking I am in Enter Query mode) and press the Execute Query button, I get two messages:
    Message 1: "Student ID found. Please Query the record or enter a new Student ID"
    Message 2: Oracle message "Do you want to save the changes? Yes/No/Cancel.
    Is there a way to stop this *Message 2?*
    Here is what I have done to try and mitigate this situation. I have created a non database field and have called it clear_form.
    In When-Validate-Item I set the field clear_form = 1 when I encounter *Message 1*
    {code}
    if t_record_exists > 0 then
    set_alert_property('ALERT_ERROR',ALERT_MESSAGE_TEXT,'Student ID found. Please Query the record or enter a new Student ID');
    alert_button := show_alert('ALERT_ERROR');
    :clear_form := 1;
    end if;
    {code}
    By creating *Key-EXEQRY* Trigger at Form Level, I was hoping that it would just clear the form. I put some messages and its seems to me that *KEY-EXEQRY* is firing first and then the *WHEN-VALIDATE-ITEM*. Is there a way to have the *WHEN-VALIDATE-ITEM* trigger fire first?
    {code}
    if :clear_form is null then
    execute_query;
    else
    clear_form(no_validate);
    end if;
    {code}
    Thanks!
    Edited by: Roxyrollers on Sep 28, 2012 8:50 AM
    Edited by: Roxyrollers on Sep 28, 2012 9:45 AM

    Having the actual Student_ID column from the table is dangerous, since it is also the key to the student's data. What if the user properly executes a query, showing a student's data, and then wants to look up another student, so keys in the new ID. If he then presses Execute Query, the Form asks "Do you want to save your changes?"
    If the user presses Yes, the new ID becomes the previous student's key.
    It would be better if you put the student_ID field in a control block. Then, the user enters a Student_ID, and presses Execute Query, the query then populates the student's data in the Base Table block. In the B_T block, the actual Student_ID column should be hidden.

  • Use an SQL Query in a backing bean

    hi,
    I like to know how to run an SQL query in a backing bean method, this being the code I tried , his goal is to fill the field "cin" with data coming from my database, here is the Code:
    public String cb2_action() {
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("CreateInsert");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    DCIteratorBinding dciter =(DCIteratorBinding) bindings.get("PersonneView1Iterator");
    Row row=dciter.getCurrentRow();
    Statement stmt = this.getDBTransaction().createStatement(1);
    try {
    ResultSet rs = stmt.executeQuery("select max(cin) from personne");
    while( rs.next() ){
    row.setAttribute("cin", rs.getInt(1)+1);
    } catch (SQLException ex) {
    ex.printStackTrace();
    return "go";
    at run time it give an error at this line : Statement stmt = this.getDBTransaction().createStatement(1);
    please check and correct me
    thanks in advance

    Hi,
    Initially I would like to say that this should not be used if you are trying to get a PrimaryKey as it would cause serious concurrency issues.
    For example lets say that you want whenever you create a new Employee to set his DepartmentId equal to the max department.
    We could create a readOnly VO (lets name it MaxDepartmentId) with a query that returns the max departmentId:
    select max(Department_Id) as maxDep from DepartmentsAfter that we need to add the MaxDepartmentId VO as a ViewAccessor in our Employees Vo,
    override the create() method in the EmployeesRowImpl and add some code like this:
    public class EmployeesRowImpl extends ViewRowImpl {
        @Override
        protected void create(AttributeList attributeList) {
            Row r=getMaxDepartmentId().first();
            if(r!=null){
                 Number max=(Number)r.getAttribute("Maxdep");
                 attributeList.setAttribute("DepartmentId", max);
            super.create(attributeList);
    }That's all.
    If you run this you will see that when you create a new employee it has a default value.
    Gabriel.

  • Use evdre to query data from a SQL View

    Hi all
    I believe that it is possible to use evdre to query data from a SQL View. If this is possible then how does one go about setting it up in the evdre options (assuming that the view has already been created)?
    Regards,
    Byron

    Byron,  perhaps this is no longer supported, it might be worth opening up a case at service.sap.com on this.  However, I did find the following on Page 11 of the "Usages and Considerations of EVDRE" pdf file.  This doc is imbedded in the helpfile for BPC 7 SP5 (which was released in August of 2009, well after note 1315011 was last updated.
    It looks like you are limited to one custom view per application, since you have to name the view in a parameter at the APPLICATION level.  Go into BPC Administration, login to the application related to the custom view, choose "Set Application Parameters" and enter the name of the view to the Application Parameter called "EVDRE_QUERYVIEWNAME"  If it is not listed, go ahead and create it at the bottom of the Application parameter screen.
    Also:  I interpreted the following info from Page 10 of the same doc:
    In your EVDRE, set the following options:
    QueryEngine: MANUAL
    QueryType:  enter either NEXJ  OR TUPLE  see below:
    NEXJ  - Use two-dimensional queries using the nonemptycrossjoin function
    TUPLE  - Use two-dimensional queries using tuples"
    And I'm assuming you'd enter a Y for the following two parameters:
    QueryViewName
    "..to enforce the query engine to use a used-defined SQL view of the fact tables, when trying to read the values using SQL queries. This option is typically used in conjunction with the SQLOnly option (see below). "
    Option SQLOnly
    "..to enforce the query engine to only execute SQL queries, when reading data. This can be achieved using this option."

  • Error while executing a report from Planning

    Hi,
    I've got this error message when I execute a report from Hyperion Planning (web) :
    "5200: Error executing query. [1106] Error : Class component property name invalid[DataType]"
    Can you help me please ?
    Thanks.
    Virgile.

    I am not sure about it. But i remember once running into a similar issue where i made some changes in the metadata or outline and few members were dropped from the hierarchy and it came up with this error at the time of running
    the report as my report was still trying to query the dropped members. But u said you have already checked and all your members are valid on the report. Is this happening with all the reports or just one. If its all the reports i would
    restart the BI+ reporting services and then try to run the reports!

  • How to look at a query string from Nav Bar Find Mode

    I would like to view the resultant query string from the Navigavtion Bar's Find Mode. I am using a Master/Detail and am querying with the selection criteria from the detail only.
    I am getting unexpected results, and would just like to SEE what the query string IS.
    Thanks

    I am getting unexpected results, and would just like to SEE what the query string IS.Run your app with diagnostic output turned on. Here's the instructions for that.
    To turn on diagnostic, go to the IDE,
    1. Select the project.
    2. Do right mouse click and select "Project Settings..."
    3. On the Settings dialog, select Configurations/Runner.
    4. In the righthand side pane, you should see a textbox for "Java
    Options". Please add the following JVM switch:
    -Djbo.debugoutput=console
    Then, rerun. The run command should include
    -Djbo.debugoutput=console as in
    "D:\JDev9i\jdk\bin\javaw.exe" -Djbo.debugoutput=console -classpath ...
    You should now see a lot more output on the IDE's message window.
    This should also include the findmode query that gets built after you hit the execute button from a findmode panel.

  • How to call a AM method with parameters from Managed Bean?

    Hi Everyone,
    I have a situation where I need to call AM method (setDefaultSubInv) from Managed bean, under Value change Listner method. Here is what I am doing, I have added AM method on to the page bindings, then in bean calling this
    Class[] paramTypes = { };
    Object[] params = { } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    This works and able to call this method if there are no parameters. Say I have to pass a parameter to AM method setDefaultSubInv(String a), i tried calling this from the bean but throws an error
    String aVal = "test";
    Class[] paramTypes = {String.class };
    Object[] params = {aVal } ;
    invokeEL("#{bindings.setDefaultSubInv.execute}", paramTypes, params);
    I am not sure this is the right way to call the method with parameters. Can anyone tell how to call a AM method with parameters from Manage bean
    Thanks,
    San.

    Simply do the following
    1- Make your Method in Client Interface.
    2- Add it to Page Def.
    3- Customize your Script Like the below one to Achieve your goal.
    BindingContainer bindings = getBindings();
    OperationBinding operationBinding = bindings.getOperationBinding("GetUserRoles");
    operationBinding.getParamsMap().put("username", "oracle");
    operationBinding.getParamsMap().put("role", "F1211");
    operationBinding.getParamsMap().put("Connection", "JDBC");
    Object result = operationBinding.execute();
    if (!operationBinding.getErrors().isEmpty()) {
    return null;
    return null;
    i hope it help you
    thanks

  • Error in while Executing Query in the Query Designer

    Hi,
    I  created info Set based two  info object and  three Data Store Objects. and join condition is Left Outer Join.
    there are Business Partner info object, CRM  BP Sales View Info Object and Data Store Objects are  BP: Roles (0BP_ROLE),Partner: Industries(0BP_IS),CRM Marketing Attributes for Business Partner(0ATR_DS01)
    I given some Selection Parameters while executing query in the Query Designer. in That i given city is selection parameters
    and i creted variable for this info object.
    it gives the Error Messages
    Beim Lesen der Daten sind Fehler aufgetreten. Navigation ist möglich
    Der Wert "New Delhi " von Merkmal 0CITY40 enthält an der 10.ten Stelle einen Fehler
    it is very urgent , can any one help me regarding this.

    Hi Reddy,
    The Error message in english is this
    While reading the data mistakes have appeared. Navigation is possible
    The value " New of Delhi " from sign 0CITY40 contains a mistake at the 10.ten place
    and i think you need to run the change run and run the report with out selecting the variable option.and navigate in the report by filtering the report for your requirement.
    Try this and let me know.
    Thanks,
    RK

Maybe you are looking for

  • Async/Sync Bridge JMS/File

    Hello, An Async/Sync Bridge with usage of the JMS adapter is described in several blogs. Is there a chance to use the JMS Adapter as a sender system and a File Adapter as the receiver system in such a scenario? Any suggestions are appreciated. Peter

  • Custom attributes are not showing up the data

    Hi, I added couple of custom fields in UWL. I followed the following blog . http://weblogs.sdn.sap.com/cs/blank/view/wlg/20379 It is showing up the columns but there is no field values(data). It is with ECC system EHP4 and portal on EHP1. I used the

  • Migration from Access with SQL Developer 1.2.2998 Does not migrate Relation

    Hi, I've almost successfully migrated an Access database to Oracle with SQL Developer with Quick Migration Option. Everything went all right, except for the tables relationships... they were not migrated. Have I forgot to do something? Thanks in adva

  • Production order--GR-Non valuated indicator

    Dear All. In which condition the system automatically tick the GR-Non valudated indicator of  the good receipt view for  the production order . Best reagrds Fanny

  • Unresponsive Document

    I am making a document in Pages for iOS that is long. I typed some of it and then took a break. After I got back, the document would not open. The app would become unresponsive except for the home button. I would close it and reopen it and no luck. I