Using a Custom Method to Set the Bind Parameters in a View Object

Hi all:
i tried to follow the tutorial in oracle jdeveloper 10.1.2 documentation about creating a simple search page but i'm receiving this error when i tried to test the application module after i added a where clause to my view object(i.e where dept_id= :1) and define a custom method to bind variables in the appmodule class
i keep getting this error
JBO-27122: SQL error during statement preparation. Statement: SELECT Employees.EMPLOYEE_ID, Employees.FIRST_NAME, Employees.LAST_NAME, Employees.SALARY, Employees.DEPARTMENT_ID Employees.DEPARTMENT_ID = :1
????? IN ?? OUT ????? ?? ??????:: 1
when i used the setwhere metohd it works
i'll apprciate ur answer
regards

I have the same problem:
Just like in Toystore Demo I am calling the following method in my VO:
   * Find an account by username and password, leaving the account
   * as the current row in the rowset if found. BUT EVEN IF WE FIND ACCOUNT BY
   * USERNAME AND PASSWORD, IT WILL RETURN FALSE IF THE ACCOUNT IS DISABLED!!!!
   * @param username the username
   * @param password the user's password
   * @return whether the user account exists or not
  public boolean findAccountByUsernamePassword(String username, String password) {
     * We're expecting either zero or 1 row here, so indicate that
     * by setting the max fetch size to 1.
    setMaxFetchSize(1);
    setWhereClause("staff_id = :0 and passw = :1");
    setWhereClauseParam(0, username);
    setWhereClauseParam(1, password);
    executeQuery();
    RowSet rs = this.getRowSet();
    String userEnabled = new String("N");  // Default setting
    if (rs != null){
      int currentSlot = rs.getCurrentRowSlot();
      Row r = rs.getCurrentRow();
      if (r == null){
         r=rs.first();
         currentSlot = rs.getCurrentRowSlot();
      //check if we found the user
      if (currentSlot == SLOT_VALID){
        Object[] av = r.getAttributeValues();
        LoginUtils.userLoggedIn    = av[0].toString();  // '0' is username
        LoginUtils.userFirstName   = av[1].toString();  // '1' is user first name
        LoginUtils.userAccessLevel = av[6].toString();  // '6' is user level
        LoginUtils.userEnabled     = av[7].toString();  // '7' is user level
        userEnabled = av[7].toString();
    boolean found = (first() != null) & userEnabled.equals("Y");
    setWhereClause(null);
    setWhereClauseParams(null);
    setMaxFetchSize(0);
    return found;
  }It gives the same exception...
JBO-27122: SQL error during statement preparation. Statement: SELECT Staff.STAFF_ID, Staff.FIRST_NAME, Staff.MIDDLE_NAME, Staff.LAST_NAME, Staff.POSITION, Staff.PASSW, Staff.USER_LEVEL, Staff.ENABLED, Staff.PHONE, Staff.EMAIL FROM STAFF Staff WHERE (Staff.STAFF_ID = :0 and Staff.PASSW = :1)
This worked in 10.0.1.2 but now it does not work in 10.0.1.3!!!

Similar Messages

  • JSP, Data Web Bean, BC4J: Setting the where clause of a View Object at run time

    Hi,
    I am trying to develop a data web bean in which the where clause of a View Object will be set at run time and the results of the query then displayed.
    My BC4J components are located in one project while the coding for the data web bean is in another project. I used the following code bu t it does not work. Could you please let me know what I am doing wrong?
    public void populateOSTable(int P_EmpId)
    String m_whereString = "EmpView.EMP_ID = " + P_EmpId;
    String m_OrderBy = "EmpView.EMP_NAME";
    oracle.jbo.ApplicationModule appModule = null;
    ViewObject vo = appModule.findApplicationModule("EMPBC.EMPAppModule").findViewObject("EMPBC.EMPView");
    vo.setWhereClause(m_whereString);
    vo.setOrderByClause(m_OrderBy);
    vo.executeQuery();
    vo.next();
    String empName numAttrs = vo.getAttribute(EmpName);
    System.out.println(empName);
    Thanks.

    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDev Team (Laura):
    Here is how I have usually done mine:
    1. In the JSP, use a RowsetNavigator bean to set the where clause and execute the query.
    2. Use a custom web bean to process the results of the query (print to HTML).
    for example:
    <jsp:useBean class="oracle.jbo.html.databeans.RowsetNavigator" id="rsn" scope="request" >
    <%
    // get the parameter from the find form
    String p = request.getParameter("p");
    String s = request.getParameter("s");
    // store the information for reference later
    session.putValue("p", p);
    session.putValue("s", s);
    // initialize the app module and view object
    rsn.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    // set the where clause string
    String theclause = "presname = '" + p + "' AND slideno=" + s;
    // set the where clause for the VO
    rsn.getRowSet().getViewObject().setWhereClause(theclause);
    rsn.getRowSet().getViewObject().executeQuery();
    rsn.getRowSet().first();
    %>
    </jsp:useBean>
    <jsp:useBean class="wt_bc.walkthruBean" id="wtb" scope="request" >
    <%
    // initialize the app module and VO
    wtb.initialize(application,session, request,response,out,"wt_bc_WT_bcModule.wtjoinView");
    wtb.render();
    %>
    In this case, the render method of my custom web bean mostly gets some session variables, and prints various content depending on the session variable values.
    Hope this helps.
    </jsp:useBean><HR></BLOCKQUOTE>
    Laura can you give the code of your walkthru bean? i wna't to initialize a viewobject, set the where clause and give that viewobject back to initialize my navigatorbar.
    Nathalie
    null

  • How to detect if a user has changed a record using a custom method?

    I am in the process of developing a test case application using ADF JSF and a collection of Java objects that are not populated by a database.
    Details of what I have developed so far can be found on this post:
    how to create a new record using a custom method?
    Is it possible to detect if a user has changed the value(s) of a record?
    I have set the edit page up (as described in the other post) and this works fine, but how could I tell if the user has changed something on that record. This is what I would like to do, but am not sure how to achieve it or whether it is possible....
    when the user puts a record in edit mode, take a copy of that record
    then when the user presses save or exit to navigate away from the edit page do a comparison between the original values and the potentially changed ones
    then depending on the outcome of the comparison call an appropriate action
    Thanks in advance for your help
    David

    If you just want to know if the value has changed you can put it in a while loop and use shift registers to see if the value has changed.
    Brian
    Attachments:
    Changed.vi ‏22 KB

  • How to use ApplicationModule custom methods in JSP?

    I have an ApplicationModule for which I have defined several custom methods (in the ApplicationModuleImpl class). I wish to invoke these methods from a JSP. I'm having trouble getting a scriptable reference to the application module object in the JSP. I can get data from the view objects using the jbo:xxx data tags, but I can't get any sort of reference to the application module object that would allow me to invoke the methods. I have tried editing the application module to expose the methods as client methods, but still can't get a reference to them.
    My main questions:
    1. Is there a way to invoke the custom methods somewhere between the jbo:ApplicationModule tag and the jbo:ReleasePageResources tag?
    2. Is there a way to declare and use the application module without using the jbo:ApplicationModule tag? Would I ever benefit from doing this?

    Alan, here's how to call a custom method String getSomeInfo() that I've created on my application module, MyModule in this example. Also, in this example the id parameter in the ApplicationModule tag is "am" (<jbo:ApplicationModule id="am"...):
    First, edit your application module. In the app module editor, go to the Client Methods tab and move getSomeInfo into the selected list.
    Next, edit your JSP to call your custom method.
    <% MyModule myAm = (MyModule)am.useApplicationModule(); String someInfo = myAm.getSomeInfo(); %>
    You also have to add the correct import statements to the page tag in your JSP:
    <%@ page contentType="text/html;charset=windows-1252" import="oracle.jbo.*, MyModule.common.*"%>
    Hope this helps
    Blaise

  • Setting bind variable for a view object from the Managed Bean

    Hi,
    i am using JDeveloper 11g, i have to create LOV in the JSF. To show the LOV, it has to populate data using View object and its query parameter need to be sent from the Managed Bean.
    For the View object i want to set the bind variable parameter from the managed bean value. bename is stored in a managed bean (session scope)
    #{beantest.bename}
    But it gives the following exception.
    JBO-29000: Unexpected exception caught:
    org.codehaus.groovy.control.MultipleCompilationErrorsException,msg=startup failed, Script1.groovy: 1: expecting '!',found '{'@ line1, column 2.
    I have followed the link http://kr.forums.oracle.com/forums/thread.jspa?threadID=615474 like Frank wrote on 8.2.2008:
    But steps are not clear.
    How to input the VO bind parameter with Managed bean variable?
    Any Help
    Regards
    Raj
    Edited by: user9928180 on Dec 17, 2008 9:51 AM

    Hi,
    a bind variable in a VO needs to be exposed as an executeWithParams operation in the pageDef file. Just add a new action binding to the pageDef file (context menu) and select the executeWithParams operation on teh VO. Then in the argument field, reference the managed bean property for the value
    Frank

  • How to set the bind variable on page load and execute query ?

    Hi All,
    I am using Jdeveloper 11.1.1.5
    I have a table called "Employee"
    Columns :- id , name , location
    Data :- 1, ,james , chicago
    2 ,Raj ,capetown
    Now i have another webservice(created as a webservice dataControl) which sends me the "id" on each time my page loads.Now the id which has been returned by webservice should be incorporated in my VO Query as in where clause to fetch the data for the respective "id" in that "Employee" table and should be rendered on form.
    Eg :- Id "2" has been sent by the webservice then the record should be fetched from database should be "2","raj","capetown".
    I know that there would be necessity of bind variable , but how do i set the bind variable on page load ?
    How can i use the bind variable appropriately ??
    Please suggest !!!!
    Thanks.

    Hi,
    Check
    http://www.orastudy.com/oradoc/selfstu/fusion/web.1111/b31974/web_services.htm#CJADCDBG
    http://thepeninsulasedge.com/frank_nimphius/2011/02/18/adf-code-corner-sample-73-released-hands-on-creating-a-search-form-using-a-pojo-ws-and-the-web-service-data-control/
    -Suresh

  • Method to set the station process model

    Hi ppl...
    I'm building a custom operator interface in LabVIEW. I want to know the method to set the station process model.
    Thanks 
    Solved!
    Go to Solution.

    Vishal
    Applications Engineer 
    Natoional Instruments
    India

  • Hi, I am using Indesign CS6, How to set the page size in Inches.

    Hi, I am using Indesign CS6, How to set the page size in Inches.

    All fields in InDesign can be entered in any measurement system. So, if you want to make an 8"x10" document and go to File>New Document and the window looks like this:
    …you can type either 8 in or 8" into the Width field like this:
    …and when you move to the next field, it will convert the eight inches into the equivalent number in the unit of measure that it is using at the moment, like this:
    … (203.2 milimeters is the same as 8 inches). You can also enter a different measurement unit into other fields once the file is created, such as the width or height of a frame, or the position of an object in the X and Y coordinates.
    If you would rather just work in inches instead of having to type the inches mark or abbreviation, go to InDesign>Preferences>General and select the Units & Increments tab. There you will see Ruler Units for Horizontal and Vertical at the top of the window. Set them to Inches and all of the fields will display in inches. If you do that to an open document, you will change the unit of measure for that document. If you do it while no documents are open, it will change the unit of measure for any new documents you create. To change the unit of measure for existing documents, you will have to open each and make the change.

  • Using applescript how do I set the angle of a gradient

    Using Applescript I need to set the angle of the gradient to 90 degrees. I've tried everything I can see in the scripting guide.
    This is a sample of the script I'm using to set the gradient all I need to know is where and how to set the gradient to horizontal. Please forgive me as I'm a real newbie at this!!!
    tell application "Adobe Illustrator"
        activate
        make new document
        set ellipseRect to {100, 100, 500, 500}
        set ellipseColor to {cyan:0.0, magenta:100.0, yellow:100.0, black:0.0}
        set myellipse to make new ellipse at beginning of current document with properties {bounds:ellipseRect, inscribed:true, reversed:false, stroke color:ellipseColor, fill color:ellipseColor}
        set Doc_Ref to the current document
        tell Doc_Ref
            if not (exists gradient "My Gradient") then
                set This_Gradient to make new gradient at end with properties ¬
                    {name:"My Gradient", gradient type:linear}
                set properties of gradient stop 1 of This_Gradient to ¬
                    {midpoint:50, ramp point:0.0, color:{cyan:0, magenta:50, yellow:100, black:0}}
                set properties of gradient stop 2 of This_Gradient to ¬
                    {midpoint:50, ramp point:100.0, color:{cyan:10, magenta:100, yellow:100, black:0}}
            end if
            if exists path item 1 then
                set fill color of every path item to {gradient:gradient "My Gradient"}
            end if
        end tell
    end tell

    I think I the gradient angle property is broken, try rotating the object setting all the "change" properties to false, except changeFillGradients.
    rotate
    (angle
    [,changePositions]
    [,changeFillPatterns]
    [,changeFillGradients]
    [,changeStrokePattern]
    [,rotateAbout])

  • How to use my findTheHighest method to find the highest value in my two dim

    I am going to create a 13row by 10 colume two dimensional array.
    how to use my findTheHighest method to find the highest value in my two dimensional array.
    .When i compile this program , i got those as following;
    "Exception in thread "main" java.lang.ArrayIndexOutOfBoundsExce
    at TaxEvolution.findTheHighest(TaxEvolution.java:31)
    at TaxEvolutionClient.main(TaxEvolutionClient.java:25)"
    public class TaxEvolution{
    public double[][] salesTaxRates;
    public TaxEvolution()
      salesTaxRates = new double[13][10];
      fillProvinTaxRates();
    private void fillProvinTaxRates()
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          salesTaxRates[row][column]= (int)(Math.random()*5000) + 1;
    public double findTheHighest()
        double highest = salesTaxRates[0][0];
        for ( int row = 0; row <= salesTaxRates.length; row++ )
          for ( int column = 0; column <= salesTaxRates[row].length; column++ )
             if ( salesTaxRates[row][column] >= highest )
                   highest = salesTaxRates[row][column];
        return highest;   
    public double[][] arrayTaxEvolution()
      double[][] returnTaxRates = new double[13][10];
      for ( int row = 0; row < salesTaxRates.length; row++ )
        for ( int column = 0; column < salesTaxRates[row].length; column++ )
          returnTaxRates = salesTaxRates;
      return returnTaxRates;
    public class TaxEvolutionClient{
    public static void main( String[] args ){
      TaxEvolution protaxRateList = new TaxEvolution();
      double[][] taxRateList = protaxRateList.arrayTaxEvolution();
        for ( int i = 0; i < taxRateList.length; i++ )
          for ( int j = 0; j < taxRateList[0].length; j++ )
            System.out.print( taxRateList[i][j] + "\t" );               
            System.out.print( protaxRateList.findTheHighest + "\t" );
    }

    Multiposted
    http://forum.java.sun.com/thread.jspa?threadID=699057&tstart=0

  • How u will set the external parameters like packet size and number

    How u will set the external parameters like packet size and number of parallel process.

    Dear Karthik,
    <b>ALE:</b>    
    Use Transaction UPSC02         -      ALE Distribution Unit: Packet Types.
    Performance Optimization for <b>ODS</b> Objects:
    To ensure a good ODS object loading performance, take the following into account:
           1.      Creating SIDs
    The creation of SIDs takes a long time and can be avoided in the following cases by:
           Not setting the indicator for BEx Reporting if you are using the ODS object only as a data store. If you do set this indicator, SIDs are created for all new characteristic values.
           If you use line items (for example, document number or time stamp) as characteristics in the ODS object, in the characteristic maintenance, indicate these as Attribute Only.
    SIDs are created in parallel if <b>parallel activation</b> is switched on (see last point). They are then created with the same number of parallel processes as created for the activation.
    However, if you specify a server group or a special server in customizing, these specifications are not only valid for the activation, but also for the SID creation. The creation of SIDs runs on the application server on which the batch job also runs.
           2.      DB partitioning in active data tables (technical A table)
    By partitioning by database level, you can delete data from the ODS object much more quickly. As a partitioning criterion, choose the characteristic by which you want to delete.  For more information on partitioning database tables, see the database documentation (DBMS-CD). Partitioning is supported by the following databases: Oracle, DB2/390, Informix.
           3.      Indexing
    Use selection criteria for queries for ODS objects. If the key fields are specified, the existing primary index is used. The more frequently accessed characteristic should appear on the left-hand side.
    If you did not specify the key fields completely in the selection criteria (visible in the SQL trace), you improve the run time of the query by creating additional indexes. You can create these secondary indexes in the ODS object maintenance.
           4.      Activation of data in an ODS object
    To improve system performance when activating data in the ODS object, you can make the following entries in Customizing under SAP Customizing Implementation Guide -> SAP NetWeaver -> Business Information Warehouse -> General BW Settings ->  ODS Object Settings:
           the maximum number of parallel processes when activating data in the ODS object as when moving SIDs
           the minimum number of data records for each data package when activating data in the ODS object, meaning you define the size of the data packages that are activated
           the maximum wait time in seconds when activating data in the ODS object. This is the time when the main process (batch process) waits for the dialog process that is split before it classifies it as having failed.
           the server group that needs to be used when activating the data in ODS objects in parallel You have to create the server groups beforehand using the following path: Tools -> Administration -> Network -> RFC Destination, RFC -> RFC Groups. If you do not specify anything here, then the activation runs on the server on which the batch process was started for activation. If a server from the server group is not active, then the activation is cancelled.
           5.      Loading unique data records
    If you only load unique data records (meaning data records with nonrecurring key combinations) into the ODS object, then the loading performance is improved when you set the indicator Unique Data Records in the ODS object maintenance.
    The records are then updated more quickly because the system no longer needs to check whether the record already exists. You do have to be sure that there duplicate records are definitely not being loaded, because this will lead to termination.
    Regards,
    Naveen.

  • How to set the font size on only one object!

    I wonder how i could programmatically set the font size on only one object?
    Igor Stojčević

    Hello,
    You can use the builtin SRW.SET_FONT_SIZE
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/builtins/srw/srw_set_font_size.htm
    in the Format trigger
    http://www.oracle.com/webapps/online-help/reports/10.1.2/topics/htmlhelp_rwbuild_hs/rwrefex/plsql/triggers/tr_format_trigger.htm
    Regards

  • When I open Safari, I always type command-plus to enlarge the view.  However, I can't figure out how to permanently set the Safari screen to this view setting in the preferences.  Any ideas?

    When I open Safari, I always type command-plus to enlarge the view.  However, I can't figure out how to permanently set the Safari screen to this view setting in the preferences.  Any ideas?

    Sorry, but you must Command + for every page. It's not permanent.
    If you haven't tried yet, check out Zoom in Safari > Preferences > Accessibility

  • How to set the connection parameters for SQL

    How to set the connection parameters for SQL to access the MS Access database
    Attachments:
    Quick_SQL.vi ‏21 KB
    Doc1.doc ‏45 KB
    db1.mdb ‏112 KB

    Right-click the WINDOWS desktop, choose New->Microsoft Data Link. That will bring up a dialog that allows you to configure and test your database connection. You might connect to the Access database via ODBC or directly via Jet Engine. The Jet Enginge saves you the trouble of creating an ODBC connection on your PC. After you leave the dialog, the "data link" will show up on your desktop as text file. Open it and copy-paste the connection string to your VI.
    This webpage is an excellent resource for connection strings: http://www.able-consulting.com/ADO_Conn.htm
    If your application requires users to change the database connection at runtime, you can also include the dialog via ActiveX (MSDASC.IDataSourceLocator).

  • How to share a bind variable across multiple view objects?

    Hi, Can someone tell me if it's possible to share a bind variable among multiple view objects within an application module? My web page displays data from different VOs on different regions. But all data should be controlled by the same bind variable, which appears in all queries. How can I achieve this?
    Please help.

    Best to state your JDev version, and technology stack (eg. ADF BC) when posting.
    I can think of 2 approaches.
    1) Create a parent VO based on SELECT :bindVar FROM dual, then create links between your other VOs and the parent
    2) Create a AM client interface method that programatically sets the bind variable in each VO.
    Can you specify your use case? This one tends to come up when discussing effective from/to dated queries.
    CM.

Maybe you are looking for

  • Gif Transparency Issue

    I have a .gif file of a logo with a white background on it. The file has a transparency (alpha channle) and cannot get rid of the background. Have also tried it as a .psd, .tiff. Any thoughts.

  • Thunderbolt ethernet not showing up in network preferences

    this is happening with both my thunderbolt display and thunderbolt<->ethernet adaptor.... the ether net in the t-bolt display WAS working.... but was having probs with the ethernet adaptor while on the road, so I tried deleting the thunderbolt ethern

  • Extrnal widescreen monitor problems

    Hi I Have recently bought a 19 inch widescreen monitor Acer AL1916w and the resolution setting is 1440 x 900 which comes up as well as the name of the monitor when it is plugged in, however it doesnt expand the full size of the screen it 's about the

  • Officejet 5750 running on Wndows 7 PC starts to print then stops and all lights start to flash.

    Printer had been working fine. Just started stopping a print after a few lines and all lights flash.Have to turn off and back on to clear. Doesn't do it every time. but does it on all programs and web printing.

  • Play Button Broken... songs wont play??!!!

    My itunes usually works fine.. but now when i go to hit the play button, nothing plays. Not my own music or bought offline music. And no the volume isnt turned off, the wierd thing is that the videos ive purchased play fine. But when i hit a song and