One datapage updating two view objects

Hi,
I have three tables:
trouble_tickets
ticket_locations (intersection table with location_id and ticket_id columns)
locations
There is a many to many relationship between locations and trouble tickets.
The customer wants one web page on which it can create trouble tickets and assign several locations to it from a multi select list.
I implemented this using ADF business components and JSP. I have a view object TroubleTicket and TicketLocation (TicketLocation is based on the intersection table). I linked these two together with a view link (one trouble ticket to many ticket locations).
With a create event for the TroubleTicket view object I go to the datapage. There I dropped the attribute to update (locationId of TicketLocation via TroubleTicket) to the datapage as LOV. For the source of the LOV list I used a third view object based on the locations table. I added multiple="true" to the html:select tag of locationId.
Now I can run the data page and it looks as expected, but when click submit with multiple or one location(s) selected I get the following error:
JBO-25039: No current row in row set iterator Iterator
This doesn't surprise me very much, but I don't know how to solve this. Can somebody help me out?
Thanks,
Joris Wijlens

I have now implemented this using a Save event and plain select list for the locations on the TroubleTicket form. The DataForwardAction of the page handles the update of the TroubleTicket data. The onSave handles storing the locations, by getting the locations values from the request and update TicketLocation programmatically with BC4J. At the end of the onSave method I do a commit. It works but is it a good way of doing this?
Joris

Similar Messages

  • Uix two view-objects on one entity-object synchronize

    Hi All
    I want to add some uix pages to an old project using ADF UIX and Business Components.
    I have an entity object to a table witch about 50 fields.
    Now I create two view objects due to a better performance. One witch seven attributes for the overwiew and one with all attributes for the detail page.
    They are related via a view link.
    I create the overview as a read-only-table and the detail-page as an input-form.
    The proplem is that the synchronization don't work. The detail page shows the first dataset ever.
    Has anyone a solution or a tip where I can found that?
    Is where a performance problem if I use one view-object for both pages?
    Thanks in advance
    Roger

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

  • Way to rollback only one row of a view object

    Is there a way to "rollback" only one row of a view object? That is, two or more rows have been modified but we wish to only restore one of the rows to the original (database) values.
    Is there a way to retain all of the current rows in all of the view objects for an application module after issuing a jbo:Rollback?
    Thanks

    Is there a way to "rollback" only one row of a view object? That is, two or more rows have been modified but we wish to only restore one of the rows to the original (database) values.In jdev903, a new method is being added to Row interface to reset the row state to the transaction-original state i.e., rollback the row to it's original values.
    Is there a way to retain all of the current rows in all of the view objects for an application module after issuing a jbo:Rollback?No. You may however override before/afterRollback methods on the ViewObjectImpl subclasses to cache the current row key in beforeRollback and restore currency on the default iterator to that rowkey in afterRollback
    Thanks

  • Create view link between two view objects (from programmatic data source)

    Hi Experts,
    Can we create a link between two view objects (they are created from programmatic datasource ; not from either entity or sql query). If yes how to create the link; ( i mean the like attributes?)
    I would also like to drag and drop that in my page so that i can see as top master form and the below child table. Assume in my program i will be only have one master object and many child objects.
    Any hits or idea pls.
    -t

    Easiest way to do this is to add additional transient attributes to your master view object, and then include those additional transient attributes in the list of source attributes for your view link. This way, you can get BC4J to automatically refer to their values with no additional code on your part.

  • Two View Objects & One Entity Object

    Has anyone ever had it where they create a row from a view object, set some attributes, insert it into that view object, and it shows up in another view object (as well as the one the row was actually inserted on)? Both of these view objects are using the same single entity object, it's just that their where clauses are slightly different. When I do a commit and then executeQuery, all is good and the new row only shows up in the intended view object.
    Here is the code in my app module to do a row insertion on one of the view objects.
    public void addQCNote(int userID, Number theStudyID, String theNote)
              try
                   //StudyFtsViewObjImpl freeTextVO = getStudyFtsViewObj();
                   StudyFtsQCOnlyViewObjImpl freeTextVO = getStudyFtsReadOnlyViewObj();
                   freeTextVO.setWhereClauseParam(0, theStudyID);
                   DBSequence freeTextTypeCode = null;
                   StudyFTSQCCodeValueViewObjImpl freeTextCodeValue = getStudyFTSCodeValueViewObj();
                   freeTextCodeValue.executeQuery();
                   Row[] freeTextCodeValueCurrentRowArray = freeTextCodeValue.getAllRowsInRange();
                   // There SHOULD only be one ... but if there is more, pick one - geeez.
                   for (int i = 0; i < freeTextCodeValueCurrentRowArray.length; i++)
                        Row currentFTRow = freeTextCodeValueCurrentRowArray[0];
                        freeTextTypeCode = ((DBSequence) (currentFTRow.getAttribute(StudyFTSQCCodeValueViewObjRowImpl.CODEVALUE1)));
                   Row freeTextRow = freeTextVO.createRow();
                   // Sets up default values for insertion into db at commit time
                   freeTextRow.setAttribute(StudyFtsQCOnlyViewObjRowImpl.PARENTENTITYID, theStudyID);
                   freeTextRow.setAttribute(StudyFtsQCOnlyViewObjRowImpl.PARENTENTITYNAME, "STUDY");
                   freeTextRow.setAttribute(StudyFtsQCOnlyViewObjRowImpl.FREETEXT, theNote);
                   freeTextRow.setAttribute(StudyFtsQCOnlyViewObjRowImpl.FREETEXTTYPECD, freeTextTypeCode);
                   freeTextRow.setAttribute(StudyFtsQCOnlyViewObjRowImpl.CREATEDID, new Number(userID));
                   freeTextVO.insertRow(freeTextRow);
                   freeTextVO.setCurrentRow(freeTextRow);
              catch (Exception ex)
                   System.out.println("Exception in AR3MainAppModule.addQCNote: " + ex.toString());
    -brian

    Did you read this?
    Re: Row created in one ViewObject added to all VOs based on the same Entity
    Why don't you search this forum before posting?
    Sascha

  • Updatable , Dynamic VIEW OBJECT ??

    Hi ,
    I want to create a dynamic VO which is updatable.
    I dont have any information about the table on which my View Object is based on, at DESIGN TIME. At run time I create query for the view and create dynamic view using AM.createViewObjectFromQueryStmt(String, String) but this kind of view will not be an updatable view.
    I think if I use createViewObjectFromQueryClauses() from entity, it will be updatable,,,but in that I will have to create entities for all the table in my schema ..which sounds BAD...
    is there any thing as DYnamic Entities ??
    or any other trick to do this.....
    BC4J should support something like changing QUERY_DATA_SOURCE_NAME at runtime in oracle forms.. which allow you to update record.
    Thanx,
    Prasoon

    Hi Prasoon,
    Steve Muench's "Dive Into BC4J" page has the following example: http://radio.weblogs.com/0118231/stories/2003/07/15/creatingUpdateableMultientityViewObjectDefinitionsDynamically.html
    But this is based on pre-defined Entity Objects. It might give you some ideas, though.
    Good luck!
    Chris

  • Insert a new row in log table when update on view object

    hi All,
    i have created approval System where i maintain log which is based on table(ApprovalLog) which contain attribute like (Agencycode,approve_status,approved_by,approved_date).
    and i have also create a view object which is based on (AgencyApproval) table. which is also contain field approval_status by default 'N'
    i create a jsf page using this view object and drag drop as adf table now i want when user change approve_status field and click on commit button then
    a new row created on to ApprovalLog table and values of column like (agencycode,approve_status,approved_by) comes from AgencyApproval table.
    How can i do this in ADF.
    Please Reply.
    manish

    hi Timo,
    i have done this as following and it is working.
    please tell me it is right approach or not.
            protected void prepareForDML(int i, TransactionEvent aTransactionEvent)
                if (i != EntityImpl.DML_DELETE)
                         ViewObjectImpl vo = (ViewObjectImpl)this.getDBTransaction().findViewObject("AdAgcrlimitAppLogView3"); // change it to the name of your VO
                           Row row = vo.createRow();
                           // set the values ...
                           row.setAttribute("AppDt",getAppDt() );
                           row.setAttribute("Publ",getPubl() );
                           row.setAttribute("GrpAgcode",getGrpAgcode() );
                           row.setAttribute("GrpAgsubcode",getGrpAgsubcode() );
                           row.setAttribute("StaticCrlimit",getStaticCrlimit() );
                           row.setAttribute("FixCrlimit",getFixCrlimit() );
                           row.setAttribute("VarcrLimit",getVarcrLimit() );
                           row.setAttribute("AdhocLimit",getAdhocLimit() );
                           row.setAttribute("AdhocFr",getAdhocFr() );
                           row.setAttribute("AdhocTo",getAdhocTo() );
                           row.setAttribute("CrAlertLimit",getCrAlertLimit() );
                           row.setAttribute("BillAmt",getBillAmt() );
                           row.setAttribute("AdjAmt",getAdjAmt() );
                           row.setAttribute("DbnAmt",getDbnAmt() );
                           row.setAttribute("PayAmt",getPayAmt() );
                           row.setAttribute("UnbillAmt",getUnbillAmt() );
                           row.setAttribute("Status",getStatus() );
                           row.setAttribute("AlertTag",getAlertTag() );
                        row.setAttribute("CrlimitTag",getCrlimitTag() );
                           row.setAttribute("Confirm",getConfirm() );
                           row.setAttribute("ApproveRemark",getApproveRemark() );
                           row.setAttribute("ApproveBy",getApproveBy() );
                           row.setAttribute("ApproveDt",getApproveDt() );
                           row.setAttribute("ApproveStatus",getApproveStatus() );
                           row.setAttribute("ApproveHier",getApproveHier() );
                           row.setAttribute("Usrname",getUsrname() );
                           row.setAttribute("Usrid",getUsrid() );
                           row.setAttribute("Usrdate",getUsrdate() );
                           row.setAttribute("Cuser",getCuser() );
                           vo.insertRow(row);
                       super.prepareForDML(i, aTransactionEvent);
            }

  • Two View objects with one Entity object

    Hi
    I have such a requirement that, I need to take some mandatory attributes of one table in one page and the remaining in following page. After clicking Submit in the second page, i need to insert data in to the table.
    How to proceed with this ? When i click on next button of first page it is validating for all mandatory fields.
    Regds,

    Use custom DataAction for the first page:
    package controller;
    import oracle.adf.controller.struts.actions.DataAction;
    import oracle.adf.controller.struts.actions.DataActionContext;
    public class Class1 extends DataAction
      protected void validateModelUpdates(DataActionContext actionContext)
         //super.validateModelUpdates(actionContext);
          // put you custom validation here
    }http://www.oracle.com/technology/products/jdev/collateral/papers/10g/ADFBindingPrimer/index.html#usingdataaction
    Message was edited by:
    Sasha
    Message was edited by:
    Sasha

  • View link creation on two view objects, and both view objects are populated program(not from sql)

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

    I have master and detail VO , both views data is loaded in program. Now for show/hide feature, I create View Link Object and using one element from both child and master VO , View Link Object created properly.
    But I can not able to add that view link object into AM.
    Now because of that , I cannot say what is a instance name of that view link object.
    Hence getting following error  -- Invalid or missing view link. Please attach view link with the bean.
    Please can you provide some directions.

  • How to create one form for two Udo object

    Hy ,
    I have two Object Udo (header and line)
    How we created a form to manage these two files (UDO)
    Thanks

    Thank you janos
    it works, I put the code to other developers for information
         Shared Sub SBO_Application_ItemEvent(ByVal FormUID As String, ByRef pVal As SAPbouiCOM.ItemEvent, ByRef BubbleEvent As Boolean) Handles SBO_application.ItemEvent
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "add") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    Dim oDS As SAPbouiCOM.DBDataSource
                    oDS = SBO_application.Forms.Item(FormUID).DataSources.DBDataSources.Item("@SIR_LOTL")
                    oDS.InsertRecord(oDS.Size)
                    oDS.Offset = oDS.Size - 1
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    oMatrix.AddRow(1)
                End If
                If ((FormUID = "SIR001_") And (pVal.ItemUID = "del") And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_CLICK) And (pVal.Before_Action = False)) Then
                    oform = SBO_application.Forms.Item(FormUID)
                    oMatrix = oform.Items.Item("mtx_0").Specific
                    For index As Integer = oMatrix.RowCount To 1 Step -1
                        If oMatrix.IsRowSelected(index) = True Then
                            oMatrix.DeleteRow(index)
                            oform.Mode = SAPbouiCOM.BoFormMode.fm_UPDATE_MODE
                        End If
                    Next
                End If
            End Sub

  • Two Queries, One View Object

    I have two fairly different ways to query the same table.
    One is a Spatial query, which returns rows that are within a radius of a starting point. This has the distance from the starting point as one of the expressions in the select list. You cannot have this expression in the select list unless the WHERE clause includes the spatial condition.
    The other way to query the table is with more "normal" WHERE clauses, like "WHERE name LIKE '%'||:nameParm||'%'", probably created as ViewCriteria. Distance is meaningless for this sort of query.
    Version one of the application solved this by having a single VO, and methods that reset the query as needed. But this had passivation/activation problems - when activated, the query would reset to the original query, but there might be bind variables left over from the other query. Solved it by not changing the query until just before it was executed. I'm not happy with this solution - it seems fragile to me.
    I could have two View Objects each with one of the queries. I envision a user interface where the user can choose which way to query the table, and some logic would have to decide which bind variables to obtain and which VO to execute. But I'd like the results from either to appear in the same ADF Faces table component. The rest of the select list is the same and would have all the same labels, etc. in the UI. I don't mind if the VO for which Distance is meaningless has a Distance attribute that is always null - I would simply set that column to not display if not appropriate.
    Possibilities: Subclass the two VOs from a third VO with a very basic version of the query, and use the parent VO in the ADF Faces table component? Or can I make the value attribute of the table dynamic - select the right VO at run time?

    Okay... no answer to this one, so I kept working on my own answer.
    Here's what I did:
    I created a VO with a very basic query that has all WHERE criteria that are common to all queries. That includes three bind variables. Call this one "BaseVO".
    I used TO_NUMBER(NULL) for the distance column that is only meaningful when you are doing a Spatial query.
    I created all of my View Links to this VO. I also did all of my UI defaults against this VO.
    Then I created two VO's that extend BaseVO. Each has the same attributes as the original, but one (call it NonSpatialVO) has View Criteria that encapsulate the non-spatial ways to query the table.
    The other VO, SpatialVO, has a different query, but it has the same select list, so it still maps to the same attributes. It has a where clause for searching by latitude and longitude, so these are bind variables. And the spatial function for the distance from the starting point replaces TO_NUMBER(NULL) in the query.
    So far, so good - the UI and View Links apply to NonSpatialVO and SpatialVO, even though they were only defined in BaseVO. It all works as expected when I run the Application Module.
    Next step - on to using the VOs in some pages in the ViewController project.
    It's going to have to decide dynamically which VO needs to be instantiated and executed, and then display the results in a table - the same table no matter which VO was used. I imagine that I'll use BaseVO to drag and drop the table on the page, but use EL to associated the correct VO with the "value" property.
    If anyone has done something like this before - your comments and advice are welcome.

  • How to set updatable property of view object on runtime

    Hello Gurus,
    I am new in adf and using jdev 11.1.2.3.
    I have two view object which has view link and they are based on entity object. In master view i have a column with the name of status. The target is if the value of status is 'active' then i want to allow add rows in detail view and if it is inactive then wants to disable adding or editing in the detail view.
    I don't know how to do this. I don't know how to get the other view object and how to set update able property and where to write code in entity object class or view object class.
    Any advice................
    Thanks in Advance

    There are multiple possible ways to archive this. As the VOs are in a master-detail relationship, you can opt to add a navigation method to the child back to the parent. This method can be accessed via java or groovy to allow the child access to the master row. Once the child has access you can use this to ask the master for it's status and if it's not active disable the edit and update buttons.
    If both master and detail are on the same page in the ui, there is an easier way. Drag the status attribute from the master table onto the page as e.g. inputText. This will create a binding for the attribute which changes if you select a row in the master table. As you don't need to inputtext, switch to the source mode of the page and delete it. This will remove the inputtext put keep the binding. Now you can use hte binding in an EL to set the disable property of other components to true like
    <af:commandButton text="commandButton 1" id="cb1" disabled="#{bindings.masterstatus.inputValue ne 'active'}"/>
    The button will only be active it the binding for masterstatus is active.
    Timo

  • Two views on one entity

    Hi,
    I am using ADF. I have one entity with one attribute called Attr. I´ve created two view objects on this entity. Let´s name them v1 and v2 and there row objects v1row and v2row
    When I execute v1row.setAttr and commit the transaction the call to v2row.getAttr returns the original value and not the new one. In my opinion this happens due to the caching mechanism.
    How can notify all views that there underlying entity has changed?
    Thanks!
    Regards,
    Christian

    I implemented two changes:
    1. Disabled database trigger
    2. replaced validate/postchanges with commit
    myAm = getNotificationImplApplicationModule();
    Test1ViewImpl v1 = myAm.getTest1View1();
    Test1View2Impl v2 = myAm.getTest1View2();
    Test1ViewRowImpl v1row;
    Test1View2RowImpl v2row;
    System.out.println("executeQuery for both views");
    System.out.println("table has exactly one row");
    v1.executeQuery();
    v2.executeQuery();
    System.out.println("navigate to first row of view 1");
    v1.first();
    v1row = (Test1ViewRowImpl)v1.getCurrentRow();
    System.out.println("V1, before setVt1:" + v1row.getVt1());
    v1row.setVt1("changed text through v1");
    System.out.println("V1, after setVt1:" + v1row.getVt1());
    System.out.println("commit changes to database");
    myAm.getDBTransaction().commit();
    System.out.println("navigate to first row of view 2 without requery");
    v2.first();
    v2row = (Test1View2RowImpl)v2.getCurrentRow();
    System.out.println("V2 without requery:" + v2row.getVt1());
    System.out.println("now requery view 2 and navigate to first row");
    v2.executeQuery();
    v2.first();
    v2row = (Test1View2RowImpl)v2.getCurrentRow();
    System.out.println("V2 with requery:" + v2row.getVt1());
    The result now is:
    04/07/26 10:24:20 executeQuery for both views
    04/07/26 10:24:20 table has exactly one row
    04/07/26 10:24:22 navigate to first row of view 1
    04/07/26 10:24:23 V1, before setVt1:initial text in database
    04/07/26 10:24:24 V1, after setVt1:changed text through v1
    04/07/26 10:24:24 commit changes to database
    04/07/26 10:24:25 navigate to first row of view 2 without requery
    04/07/26 10:24:26 V2 without requery:initial text in database
    04/07/26 10:24:29 now requery view 2 and navigate to first row
    04/07/26 10:24:53 V2 with requery:changed text through v1
    As you can see view 2 still gives the initial value without requery.

  • How do I obtain the next number for a Primary Key using an ADF View Object?

    I have two separate View Objects (A & B) for the same Entity Object. View Object A does a SELECT on all of the fields in the table. This View Object is where I execute my adds and updates. View Object B is only used to retrieve the next number for the primary key. This is done so that when I add a row to the database, I always get the max number of the primary key and add one to it. I accomplished this by setting the SQL mode to Expert and using the SQL: "SELECT MAX(NBR) AS MAX_NUMBER FROM TABLE_1". This may be overkill having a seperate View Object for this, but so far this is the only way I have found to obtain the next number. However, I have discovered that this way does not always work.
    The problem I'm running into is when I try to add multiple records to View Object A without committing the transaction between each add. Because View Object B is disconnected from View Object A, the MAX_NUMBER of View Object B comes back with the same number for each add I do on View Object A. So I know I must retrieve the MAX_NUMBER from View Object A.
    I've tried using the following code in my Table1ViewImpl class:
    this.setQuery("SELECT MAX(Table1.NBR) AS MAX_NUMBER FROM TABLE_1 Table1");
    this.executeQuery();
    The view object now has what I want, but I have yet to figure a way to extract the MAX_NUMBER out of the View Object. I've also looked into using the method addDynamicAttribute() but I can't figure out any way to set the attribute with the MAX_NUMBER.
    I can't be the only one trying to retrieve the next number from a database table using ADF. Can anyone help me with this? FYI - I'm using JDev 10.1.3 EA.

    You missing the point.
    On a multi-user db knowing the next highest number doesn't guarantee the number will be available when it comes time to commit the record. You can prove this to yourself by opening two instances of your app and do whatever you do to add a new record to your VO. Both will assume the same number, and when you commit an error will be generated
    You must use sequences to avoid the possibility of duplicate keys. If you are trying to avoid gaps in your numbering then you need to convince yourself why this is necessary.

  • Problem in using View Object for validation

    Hi,
    I have defined a simple swing form to practice. It has one Entity Object and two View objects. One of these view objects is an updatable VO based on the EO and the other one has a simple "select count(*)" from a table. I defined a method validation on one of the EO attributes to see how can i use the VO for validation. On the other hand i defined the Application Module to use both of my views. As far as i undrestood, when i define a VO for AM, the AM will instantiate it the first time it starts running. Here is the code inside the method validation for FirstName attribute:
    /**Validation method for FirstName
    public boolean validateFirstName(String data) {
    ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject("CountEmployeeInstance");
    if (vo == null) {
    System.out.println("vo is null");
    else {
    vo.executeQuery();
    if (vo.hasNext()){
    System.out.println("count = " + ((CountEmployeeRowImpl) vo.next()).getCount());
    else {
    System.out.println("vo has no next");
    return true;
    The problem is that vo.executeQuery() does not return any record. In fact the vo.hasNext() returns false and i get the message "vo has no next" on the console. Please pay attention that the VO's sql statement is SELECT COUNT(*) and it always returns a record. I found that if i use vo.closeRowSet() before vo.executeQuery() everything works fine.
    Please tell me that what is my problem and why is it working like this?
    Best Regards,
    Alireza Vali

    Chris,
    1- Every thing is fine with the ADF model layer in this practice. I have tested it by using Test option on AM and it works. It works exactly the same as how it works throug swing UI that i use for it.
    2- The VO is beeing found and as you see in the code, i have tested it by "if (vo == null)" just after the statement which finds it and vo is not null which means it has been instantiated by AM as it was supposed to.
    3- The VO's SQL statement is "SELECT COUNT(*) FROM EMPLOYEE" with no where clause. I have 14 records in this table.
    Every thing is OK with swing form. It runs and shows the records and all the binded operations like "next record", "previous record" and so on work perfectly on the records.
    4- The code i used is a combination of two examples. Example 9-7 and 9-8 in pages 9-12 and 9-13 of mentioned document.
    Now my findings:
    I changed the code to the following:
        /**Validation method for FirstName
        public boolean validateFirstName(String  data) {
            ViewObject vo = getDBTransaction().getRootApplicationModule().findViewObject("MaxEmployeeIdInstance");
            if (vo == null) {
                System.out.println("vo is null");
            else {
                //vo.closeRowSet();
                vo.executeQuery();
                System.out.println("Row Count = " + vo.getRowCount());
                System.out.println("Default Slot = " + vo.getCurrentRowSlot());
                vo.next();
                System.out.println("Slot after next() = " + vo.getCurrentRowSlot());
                vo.reset();
                System.out.println("Slot after reset() = " + vo.getCurrentRowSlot());
                vo.first();
                System.out.println("Slot after first() = " + vo.getCurrentRowSlot());
                vo.last();
                System.out.println("Slot after last() = " + vo.getCurrentRowSlot());
                System.out.println("----------------------");
                vo.executeQuery();
                System.out.println("Deafault index = " + vo.getCurrentRowIndex());
                vo.next();
                System.out.println("Index after next() = " + vo.getCurrentRowIndex());
                vo.reset();
                System.out.println("Index after reset() = " + vo.getCurrentRowIndex());
                vo.first();
                System.out.println("Index after first() = " + vo.getCurrentRowIndex());
                vo.last();
                System.out.println("Index after last() = " + vo.getCurrentRowIndex());
                System.out.println("Slot Before First = " + vo.SLOT_BEFORE_FIRST);
                System.out.println("Slot Beyound Last = " + vo.SLOT_BEYOND_LAST);
            return true;
        }Here are the results :
    Row Count = 1
    Default Slot = 0
    Slot after next() = 3
    Slot after reset() = 0
    Slot after first() = 0
    Slot after last() = 0
    Deafault index = 0
    Index after next() = -1
    Index after reset() = 0
    Index after first() = 0
    Index after last() = 0
    Slot Before First = 2
    Slot Beyound Last = 3
    As you see, after the execution of the statement "vo.executeQuery()" the The RowIterrator pointer is not pointing to the slot before the first record but it is pointing to the first record itself. And that is why the statement "if (vo.hasNext()" returns false because we just have one record and RowIterrator Index is standing on that record and there is no next record present. The very important thing is that even reset() method does not set the index to the slot before the first record and it sends it to the first record.
    After that, i took the statemet "vo.closeRowSet()" out of the comment and here are the results:
    Row Count = 1
    Default Slot = 2
    Slot after next() = 0
    Slot after reset() = 2
    Slot after first() = 0
    Slot after last() = 0
    Deafault index = -1
    Index after next() = 0
    Index after reset() = -1
    Index after first() = 0
    Index after last() = 0
    Slot Before First = 2
    Slot Beyond Last = 3
    These are the exact things that we expected from the first. After query execution, the pointer is set to the slot before first record and the reset() method does its defined job which is sending the pointer to the slot before the the first record.
    My Assumptions:
    The Rowset which is created by AM is somehow different from the RowSet which you create in your program. I am absolutely sure that this functionality is not a bug but a design decission. I look at my simple program and see that when it runs, the data is queried and shown on the screen which is all done by AM by instantiating my VO and executing the query on it. AM reasonably must put the RowSet pointer on the first record and not the slot before first record. And i am sure that if i use reset() method on the shown RowSet, the pointer goes to the first record and the data on the screen does not get cleared. Whe we use vo.closeRowSet() and execute the query again, the AM made RowSet is closed and a new one is created and the new RowSet is your's not AM's so it functions as you expect.
    Best Regards,
    Alireza Vali

Maybe you are looking for