Using two resultset objects?

hi guys,
I have always created on ResultSet and used that over and over again...I now have a situation where inside a while (rs.next()) I have to create another SQL query. Does this mean I should create a NEW Statement from the same Connection, and then have a new ResultSet
Statement secondStatement = conn.createStatement();
ResultSet secondResultSet = secondStatement.executeQuery("My QUERY");Is this right?

You will need to open another Connection, Statement and (presumably) ResultSet. However, if you are seeing logic like this, there is probably a better way to write the SQL statement itself (either via a UNION or a correlated sub-query) so that it only executes once.
- Saish

Similar Messages

  • Two resultset objects

    IS it possible to define two resultset objects with two different queries inside the same DB class?java.sql.SQLException: Invalid state, the ResultSet object is closed.
         at net.sourceforge.jtds.jdbc.JtdsResultSet.checkOpen(JtdsResultSet.java:299)
         at net.sourceforge.jtds.jdbc.MSCursorResultSet.next(MSCursorResultSet.java:1123)
         at DB5.getDetails(Daily_Quote_Response_report.java:238)
         at Daily_Quote_Response_report.main(Daily_Quote_Response_report.java:74)
    java.util.List items = null;
            String query;
            String query2;
            try {
                query =
                       "select * from oqrep_except_resp_summary";
                query2 = "select * from oqrep_except_resp_detail";
                Statement state = conn.createStatement(ResultSet.TYPE_SCROLL_SENSITIVE,
                        ResultSet.CONCUR_READ_ONLY);
                ResultSet rs = state.executeQuery(query);
                ResultSet rs2 = state.executeQuery(query2);
              //cannot create two rs objects // ResultSet rs2 = state.executeQuery(query);
                items = new ArrayList();Edited by: bobz on 03-Dec-2009 11:16
    Edited by: bobz on 03-Dec-2009 11:16

    Note: This thread was originally posted in the [Java Programming|http://forums.sun.com/forum.jspa?forumID=31] forum, but moved to this forum for closer topic alignment.

  • Error while saving data using two entity objects (EO)

    Hi All,
    i am using two entity objects for saving the date in two different tables.
    on my page i am having two tables and two save buttons for saving the data in the respective tables.
    if i am not entering any data on the first table and putting valid data on the second table and click on the save button.
    it is going into error saying "Null Pointer Exception"..
    i am using getTransaction.commit() in my AM.
    so it is trying to save all the data in both the tables.
    i want to commit data of the respective table for which the save button is clicked.
    Waiting for ur reply

    Hi,
    i am using the following code for saving the data in the AM
    // TO SAVE THE JOB ASSIGNMENT DETAILS
    public void saveJobAssignmentDetails(String projectId)
    EmpAssignmentVOImpl empAssignVO = getEmpAssignmentVO1();
    getTransaction().commit(); // Line where i am getting the error
    rowNumberCountJobAssign = 0; // IN JOB ASSIGNMENT
    // EXECUTING THE DISPLAY FUNCTION AGAIN SO TAHT ALL SAVED FIELD ARE READONLY AS REQUIRED
    displayJobAssign(projectId);
    if(empAssignVO.getRowCount() != 0)
    throw new OAException("Job assignment details have been saved successfully. ",OAException.CONFIRMATION);
    Stack trace :
    oracle.apps.fnd.framework.OAException: oracle.jbo.DMLException: JBO-26041: Failed to post data to database during "Insert": SQL Statement "BEGIN INSERT INTO pa_job_bill_rate_overrides(START_DATE_ACTIVE,LAST_UPDATE_DATE,LAST_UPDATED_BY,CREATION_DATE,CREATED_BY,LAST_UPDATE_LOGIN,BILL_RATE_UNIT,PROJECT_ID,RECORD_VERSION_NUMBER,JOB_BILL_RATE_OVERRIDE_ID,RATE_CURRENCY_CODE) VALUES (:1,:2,:3,:4,:5,:6,:7,:8,:9,:10,:11) RETURNING JOB_BILL_RATE_OVERRIDE_ID, JOB_ID, START_DATE_ACTIVE, LAST_UPDATE_DATE, LAST_UPDATED_BY, CREATION_DATE, CREATED_BY, LAST_UPDATE_LOGIN, RATE, BILL_RATE_UNIT, PROJECT_ID, TASK_ID, END_DATE_ACTIVE, RECORD_VERSION_NUMBER, RATE_CURRENCY_CODE, DISCOUNT_PERCENTAGE, RATE_DISC_REASON_CODE INTO :12, :13, :14, :15, :16, :17, :18, :19, :20, :21, :22, :23, :24, :25, :26, :27, :28; END;".
         at oracle.apps.fnd.framework.OAException.wrapperInvocationTargetException(OAException.java:972)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:210)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    ## Detail 0 ##
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("PA"."PA_JOB_BILL_RATE_OVERRIDES"."JOB_ID")
    ORA-06512: at line 1
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2154)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2036)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2880)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:371)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5108)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.schema.server.JobBillRateEOImpl.doDML(JobBillRateEOImpl.java:124)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4015)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(OAEntityImpl.java:1676)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2694)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2540)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1783)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1976)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(OADBTransactionImpl.java:680)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.server.jobBillRateAndAssignmentAMImpl.saveJobAssignmentDetails(jobBillRateAndAssignmentAMImpl.java:772)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:189)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)
    java.sql.SQLException: ORA-01400: cannot insert NULL into ("PA"."PA_JOB_BILL_RATE_OVERRIDES"."JOB_ID")
    ORA-06512: at line 1
         at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
         at oracle.jdbc.ttc7.TTIoer.processError(TTIoer.java:289)
         at oracle.jdbc.ttc7.Oall7.receive(Oall7.java:583)
         at oracle.jdbc.ttc7.TTC7Protocol.doOall7(TTC7Protocol.java:1983)
         at oracle.jdbc.ttc7.TTC7Protocol.parseExecuteFetch(TTC7Protocol.java:1141)
         at oracle.jdbc.driver.OracleStatement.executeNonQuery(OracleStatement.java:2154)
         at oracle.jdbc.driver.OracleStatement.doExecuteOther(OracleStatement.java:2036)
         at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:2880)
         at oracle.jdbc.driver.OraclePreparedStatement.executeUpdate(OraclePreparedStatement.java:622)
         at oracle.jdbc.driver.OraclePreparedStatement.execute(OraclePreparedStatement.java:698)
         at oracle.jbo.server.OracleSQLBuilderImpl.doEntityDML(OracleSQLBuilderImpl.java:371)
         at oracle.jbo.server.EntityImpl.doDML(EntityImpl.java:5108)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.schema.server.JobBillRateEOImpl.doDML(JobBillRateEOImpl.java:124)
         at oracle.jbo.server.EntityImpl.postChanges(EntityImpl.java:4015)
         at oracle.apps.fnd.framework.server.OAEntityImpl.postChanges(OAEntityImpl.java:1676)
         at oracle.jbo.server.DBTransactionImpl.doPostTransactionListeners(DBTransactionImpl.java:2694)
         at oracle.jbo.server.DBTransactionImpl.postChanges(DBTransactionImpl.java:2540)
         at oracle.jbo.server.DBTransactionImpl.commitInternal(DBTransactionImpl.java:1783)
         at oracle.jbo.server.DBTransactionImpl.commit(DBTransactionImpl.java:1976)
         at oracle.apps.fnd.framework.server.OADBTransactionImpl.commit(OADBTransactionImpl.java:680)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.server.jobBillRateAndAssignmentAMImpl.saveJobAssignmentDetails(jobBillRateAndAssignmentAMImpl.java:772)
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:324)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:189)
         at oracle.apps.fnd.framework.server.OAUtility.invokeMethod(OAUtility.java:152)
         at oracle.apps.fnd.framework.server.OAApplicationModuleImpl.invokeMethod(OAApplicationModuleImpl.java:721)
         at tcsl.oracle.apps.pa.jobBillRateAndAssignment.webui.jobBillRateAndAssignmentCO.processFormRequest(jobBillRateAndAssignmentCO.java:357)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:799)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.OAPageLayoutHelper.processFormRequest(OAPageLayoutHelper.java:1118)
         at oracle.apps.fnd.framework.webui.beans.layout.OAPageLayoutBean.processFormRequest(OAPageLayoutBean.java:1579)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.form.OAFormBean.processFormRequest(OAFormBean.java:395)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:995)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequestChildren(OAWebBeanHelper.java:961)
         at oracle.apps.fnd.framework.webui.OAWebBeanHelper.processFormRequest(OAWebBeanHelper.java:816)
         at oracle.apps.fnd.framework.webui.OAWebBeanContainerHelper.processFormRequest(OAWebBeanContainerHelper.java:363)
         at oracle.apps.fnd.framework.webui.beans.OABodyBean.processFormRequest(OABodyBean.java:363)
         at oracle.apps.fnd.framework.webui.OAPageBean.processFormRequest(OAPageBean.java:2633)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:1659)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:497)
         at oracle.apps.fnd.framework.webui.OAPageBean.preparePage(OAPageBean.java:418)
         at OA.jspService(OA.jsp:40)
         at com.orionserver.http.OrionHttpJspPage.service(OrionHttpJspPage.java:56)
         at oracle.jsp.runtimev2.JspPageTable.service(JspPageTable.java:317)
         at oracle.jsp.runtimev2.JspServlet.internalService(JspServlet.java:465)
         at oracle.jsp.runtimev2.JspServlet.service(JspServlet.java:379)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
         at com.evermind.server.http.ServletRequestDispatcher.invoke(ServletRequestDispatcher.java:727)
         at com.evermind.server.http.ServletRequestDispatcher.forwardInternal(ServletRequestDispatcher.java:306)
         at com.evermind.server.http.HttpRequestHandler.processRequest(HttpRequestHandler.java:767)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:259)
         at com.evermind.server.http.HttpRequestHandler.run(HttpRequestHandler.java:106)
         at EDU.oswego.cs.dl.util.concurrent.PooledExecutor$Worker.run(PooledExecutor.java:803)
         at java.lang.Thread.run(Thread.java:534)

  • Two response objects within one servlet...

    Heya guys, quite new to java and got stuck for the whole day on this.
    I need to combine two responses inside one servlet. One response retrieves picture from the database and it works fine. Another one retrieves text from database also works fine on its own. Second i try to use both end up with hundreds of exceptions.
    Any idea what to do, not how...but what???
    Thanks

    Compiling 1 source file to F:\gopal\weba\WebApplication6\build\web\WEB-INF\classes
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:48:
    processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    F:\gopal\weba\WebApplication6\src\java\NewServlet.java:57: processRequest(javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse,javax.servlet.http.HttpServletResponse) in NewServlet cannot be applied to (javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse)
    processRequest(request, response);
    2 errors
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:295: The following error occurred while executing this line:
    F:\gopal\weba\WebApplication6\nbproject\build-impl.xml:149: Compile failed; see the compiler error output for details.
    BUILD FAILED (total time: 2 seconds)
    You cannot use two response object.

  • Two Business Objects to fill a Data Grid/table using Anchors?

    Hi,
    I have a SAP standard tile were a table (grid) is filled by an Business Object. I want to add an additional column and retrieve the value from another Business Object.
    My questions
    1) Can I use Anchors to automatically set the relationship between two Business Objects A & B, so that I can just Drag & Drop an additional field from Business Object B to the DataGrid of Business Object A in the design screen without writing additional code?
    2) Some BO's do come with a predefined relationship to other BO's, but in the case of I have to write a supply function do I have to use a specific "Data Source Type" such as "Business Object", "BusinessQuery" or "Business CollectioN"?
    3) I already tried to write a supply function, but I realized that the system does return for some BO's or BS's a object instance, if I call "gFactory.newBusinessQuery". Is there any logic/restriction behind?
    I know I can use RowLoaded2 and a unbound column, but I want to know if this approach is also possible?
    Thank you for any help,
    Regards,
    Andreas

    Hi Andreas,
    The answer to your question is YES. You can very well do it without any changes at the code level.
    The scenerio can be implemented using a concept called JointField Mapping in MAS.
    Scenerio 1 :
    If you want to display the extra field from another BO in a list tile on the click of a search button from the search tile , then
    Please do the following :
    1. Select the Busines Query that you have associated to the search tile and go to properties from the View Designer.
    2. In the properties, Click on the Joint Field Mapping and select the BO where the extra field id present and select the primary key, Segment Field associated, (extra field)BO Property that you want to display in the list tile.
    2. Add a new control (new Field) in the List tile - ie, From the Toolbox (Tileset COntrols).
    3.Go to properties of the newly added control. Associate the anchor as the same achor as the list tile was pointing to earlier. for eg : Y_BOCAPGEN.
    4. Then Go to BCOLFieldName property and give the property name as the newly added BO property name(New field).
    After everything is modelled, You will be able to see the extra field in your application!!!!
    NOTE : Ofcourse, After the Successful generation.
    Scenerio 2 :
    If you want to display an Extra Field in a Detail tile,
    1. Go to Relationship of the BO from the Detail tile and go to properties.
    2. In the properties, You can find the Joint Field Mapping porperty.
    3. This property is again modelled as explained in scenerio 1.
    Hope, It would have definetly helped and answered your query.
    Have a good day!!
    Best Regards,
    Vignesh Ravikumar.

  • Using all types of resultset Objects i need a single program

    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e
    # next() - moves the cursor forward one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned after the last row.
    # previous() - moves the cursor backwards one row. Returns true if the cursor is now positioned on a row and false if the cursor is positioned before the first row.
    # first() - moves the cursor to the first row in the ResultSet object. Returns true if the cursor is now positioned on the first row and false if the ResultSet object
    does not contain any rows.
    # last() - moves the cursor to the last row in the ResultSet object. Returns true if the cursor is now positioned on the last row and false if the ResultSet object
    does not contain any rows.
    # beforeFirst() - positions the cursor at the start of the ResultSet object, before the first row. If the ResultSet object does not contain any rows, this method has
    no effect.
    # afterLast() - positions the cursor at the end of the ResultSet object, after the last row. If the ResultSet object does not contain any rows, this method has no effect.
    # relative(int rows) - moves the cursor relative to its current position.
    # absolute(int n) - positions the cursor on the n-th row of the ResultSet object.
    Using all these result set methods i need a sample program all these methods must be used in a single program itself

    BalajiEnntech123 wrote:
    i think all of u know that there are 8 types of resultset objects are there in jdbc technology i.e I don't know who "u" are but they're wrong if they think there are "8 types of resultset objects are there in jdbc technology".
    They'd be especially wrong to think that the methods you mention are "types of resultset objects".

  • How to use two activex class objects in same vi

    HI
    I am using labview to read ECU data from INCA software .INCA providing COMTOOL API(incacom.dll). I am using ACTIVEX for  communication between INCA & Labview. My problem is If I have used single activex class object  I am able to read Inca version, getting the database path etc. If I have used two activex class in same vi (one to open Inca & other one is to read the folder structure) I am not getting output.I have attached snapshot for referance
    Attachments:
    activex1.JPG ‏114 KB
    activex2.JPG ‏107 KB

    It wasnt in the first two images you posted, or I couldnt see it anyway! That was the only reason.
    Did you try the database block on its own, just to confirm that it is working?
    Beginner? Try LabVIEW Basics
    Sharing bits of code? Try Snippets or LAVA Code Capture Tool
    Have you tried Quick Drop?, Visit QD Community.

  • Using the same object in two actors at the same time

    Hello,
    I'm in doubt.  In my application, for example i have three Hardware classes - Database, DAQ1, DAQ2.
    Database class has one main method (except initialization methods) - Log Measure.
    DAQ1 class also has one method - Get Voltage, and DAQ2 class has one method - Get Current.
    Then i define two HAL (Hardware Abstraction Layer) classes - Measurement1 and Measurement2.
    Each of those classes have two main methods, respectively - Measure Voltage and Measure Curent. They also have some initilziation methods.
    In code, i create three objects of Hardware classes - Database, DAQ1 and DAQ2 and initiaze it. For example in Database private cluster i have DB RefNum, in DAQ1&2 i have device addresses etc.
    Next I initialzie Measurement1 with two hardware objects - Database and DAQ1, and in the same way - Measurement2 with Database, and DAQ2 objects.
    What Measure Voltage and Measure Curent (methods of Measurement1 and Measurement1 objects) do?
    Measure Voltage method call DAQ1::Get Voltage method, then Database::Log Measure.
    Similarly, Measure Current method call DAQ2::Get Voltage method, then Database::Log Measure.
    Till now it's clear i think. It should work properly.
    But now i incorporate Actor Framework, and define Measurement1 and Measurement2 as an actors.
    Now i can run Measurement1 and Measurement2 at the same time, simultaneously, but this two actors share one object - Database. So my question - what is when actors want to use Database::Log measure method at the same time and this method is time cosuming (for example large pack of data).
    Is one actor waits for second to stop executing this method of one shared object? I think yes because reentrancy setting (http://zone.ni.com/reference/en-XX/help/371361J-01/lvconcepts/reentrancy/)
    But what, for example if i share one Hardware object of device (ADC converter) beetwen two HAL classes (Measurement1 and Measurement2). This Hardware object has two methods, for ex. Get Voltage At channel 1, and Get Voltage At Channel 2. Both of this methods cannot by call at the same time, because in physical device i can measure only at one channel in the same time.
    Let the Get Voltage At channel X meausere take 10 seconds. Now i have huge chance, that Measurement 1 actor call Get Voltage At channel 1 method, and Measurement 2 wants to call Get Voltage At channel 2, when Get Voltage At channel 1 is in process. How to inform actor to wait till second actor release device resources?
    Regards,
    Kacper

    Dear Kacper,
    the way I understood, there are two separate questions in this post, namely:
    I'm using a shared resource in multiple actors, and the code accessing the resource can take quite some time to execute. How can can I ensure this does not mess up the timing of one or all accessors?
    I'm using a shared resource in multiple actors, and the code accessing the resource can generate errors if I try to access it from multiple places. How can I ensure synchronization between all accessors?
    As for the first question, the optimal solution to separate the resource prone to timing issues in a different thread/actor. Put anything that is not strictly timed (file access, network comunication) in a separate loop. For each actor, you will get queue references to communicate with, so instead of logging the measurements in the actors where they are made, just queue them up for a different loop to process.
    For the second part, the same logic still applies. Ideally, every singular resource should be handled by its own thread and nowhere else, so if anything else needs data from/to said resource, it can send a request to the dedicated thread or actor.
    If, for some reason, this is not sufficient, you have to handle synchronization in some other way. There are a lot of techniques here, for example:
    Create a named semaphore or lock as a part of the class. Have class functions use the semaphore before accessing the resource.
    Use actor messages. Have a "resource in use" or "resource released" messages sent to all users whenever obtaining or releasing said resource.
    Have a separate actor handle all resources, awarding them to threads needing them. This method also allows setting priorities between requests.
    These are just a few examples, there are many other options.
    Please let me know if this was helpful. 
    Kind regards:
    Andrew Valko
    National Instruments Hungary

  • Linking two ODS objects using a multiprovider

    Hello Gurus,
    I need to link two ODS objects and both are having 3 common characteristics and the relationship between the two objects are one to many.
    My questions would be....
    1)When the relationship is one to many can I set it up in the multiprovider to sum it up and show in the report?
    2)I have 5 other charaterstics that I need to report(Slice and dice) on, but these are not common ones to both ODS objects. Is it possible for the user to get the report based on these charaterstics also? Or do I need to make sure that these 5 also exist in both DOS objects?
    Thank you,
    DM

    Hi Sh,
    Thank you very much for your reply. But I have few concerns.
    1)One to many relationship will not have any effect on the data linking since the multiprovider clubs the key figures on common characteristics. I tried this on the system and it worked.
    2)The problem would be not having similar characteristics on both infoproviders. So if I want to report on the chars individually it will have a problem( Will come as non assigned values)
    But the documentation says the multiprovider supports Homogenous and Heterogeneous cases. Please refer the following link.
    http://help.sap.com/saphelp_nw04/helpdata/en/52/1ddc37a3f57a07e10000009b38f889/frameset.htm
    I am not sure what I can do now....whether to get all the characteristics in both infoproviders by enhancing the them. Or is there another way?
    And lastly the scenario I am looking at is billing and cost of goods. So I might find records in cost of goods which may not have corresponding records in billing.(There can be goods in stock which need to be billed)The problem would be the way multiprovider link records(union) so it will have all the records from both sides even if they do not correspond to each other.
    Let me know what you think.
    Cheers,
    DM

  • Adding two ResultSets in java

    How can we add two resultsets in java ?

    screen_simu wrote:
    Is it something we can do in java?OP, if you can do it in SQL, that likely would be better. On the other hand, do you mean that want to add the results from two resultsets that might perchance be different? IOW ... if both ResultSets produce the same columns, then a UNION join in SQL:select
        tableA.empl_name,
        tableA.empl_id
      from tableA
    UNION
    select
        tableB.empl_name,
        tableB.empl_id
      from tableBBut, if you want to select out specific columns from differing RS's, then you might want to do this:
      List<Empl> empList = new ArrayList<Empl>();
      public class Empl {
        private String empl_id;
        private String empl_name;
        private Double empl_wage;
        public void setName(String name) {
          empl_name = name;
    // ... etc, other method implementations ...
    // ... SQL stuff ...
      String sqlA =
         "select"
        +"    tableA.empl_id,"
        +"    tableA.empl_wages"
        +"  from tableA";
    // ... rsA is the ResultSet from the tableA selection
      Empl empl = null;
      while (rsA.next()) {
        empl.setID(rsA.getString(1));
        empl.setWage(rsA.getDouble(2));
        empl.setName(processTableB(empl.getID()));
        empList.add(empl);  // new Empl Object for each employee
      public String processTableB(String id) {
        String name = null;
      String sqlB =
        "select"
        +"    tableB.empl_name"
        +" from tableB"
        +" where tableB.empl_id = ?"
    // ... set up PreparedStatement ... using passed in id
    // ... process ...
      while (rsB.next()) {
        name = rsB.getString(1);
      return( name );
    }Above code untested, but hopefully you get the idea.

  • ??how to compare two resultsets??

    hi all!
    i need to find out whether two resultsets contain the same data.
    the only way i know how to do it in java is to put them into a while loop and fetch the contents first and then compare the contents.
    but is there an easier way to compare resultsets?
    does anyone know how to compare two resultsets without extracting the data?
    the code example here executes two identical queries on an oracle database, compare and print the resultsets.
    public ResultSet getResultset(String query)
    ResultSet rs=null;
    try { rs=Stmt.executeQuery(query); }
    catch(Exception e) { e.printStackTrace(); }
    return rs;
    public static void main(String[] args) {
    ResultSet r1=null;
    ResultSet r2=null;
    try {
    database db = new ddatabase();
    r1=db.getResultset("Select 'name' from person");
    r2=db.getResultset("Select 'name' from person");
    if (r1 == r2) {
    System.out.println("ok");
    System.out.print(r1);
    System.out.println();
    System.out.print(r2);
    else {
    System.out.println("not ok");
    System.out.print(r1);
    System.out.println();
    System.out.print(r2);
    jdbc.cleanup();
    catch(Exception e) {e.printStackTrace();}
    and here is the output:
    F:\java rs_compare
    not ok
    oracle.jdbc.driver.OracleResultSetImpl@4413ee
    oracle.jdbc.driver.OracleResultSetImpl@786e64
    as you can see the resultsets are different though the data they contain have to be the same.
    so the 'if(resultset#1 == resultset#2)' does not work.
    thanks for any help
    best regards
    5ithl0rd

    Don't cross-post.
    I'll bet ResultSet implementations don't override equals() to provide "deep equals" behavior, in which case it'll be no different than using "==".
    It's a bad idea to compare two ResultSets this way. You'll have to load both into objects or data structures and compare those in a "deep" way.
    Besides, the ONLY way two ResultSets could be different, given the same query, would be if there were multiple clients that could write to the table between queries and change the underlying data. If your two queries are sufficiently isolated, I'd say that the same query will return the same ResultSet.
    %

  • Two remote objects calls on the same php class

    Hi to all,
           I've encountered a strange issue while developing with remote objects.
    I've a mxml component with an init() method inside which is called by a menu.
    When the init() method is called it makes 7 remote object calls which are bound to some components' dataprovider.
    Among this calls I've got 2 remote object which refer to the same remote class. This because I have to call the class twice and the bind the result to two different combobox. Below you find the code:
    <mx:RemoteObject id="myFile" source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    <mx:RemoteObject id="myXls"  source="myRemoteClass" destination="amfphp"  showBusyCursor="true" makeObjectsBindable="true" fault="traceFault(event)"/>
    in the init function I make this calls:
    myFile.listDir("dir_1")
    myXls.listDir("dir_2")
    then in the mxml code I bound the result of myFile to combobox1 and the result of myXls on combobox2.
    The problem arise when I call the myXls' listDir method. When I call it I receive the following error:
    code:
    Client.Error.DeliveryInDoubt
    Message:
    Channel disconnected
    Detail:
    Channel disconnected before an acknowledgement was received
    The strange thing is that not only the myXls object returns this error, but also all the other 6 remote object return the same error above.
    I'm not sure, but I guess that the error could be caused by the two remote object which call the same php remote class. If I comment one of the two calls everything works fine.
    Do you have any suggestion about?
    Thanks!!
    Bye
    Luke

    Hi Jan.
    1) We have the 2 VO, each with 3 rows to fill in data. What I mean is that when i just fill in all the fields for the first row of the first VO, and the value of one of these fields is bigger than 50, then after the exception is thrown and the message is displayed, the fields for the first VO are duplicated and shown in the second VO as if the user had inserted them.
    2) We tried yesterday the validateEntity and a Method and Atributte Validator approaches after reading that white paper with the same results.
    The validation is correctly done using any of the those methods.
    I will try to reproduce this issue with the HR schema.
    Thanks in advance once again.

  • Two authorizations objects with OR function instead of AND

    Hi,
    We have created two authorization (RSECADMIN) objects for a CRM InfoProvider:
    Organizational responsible
    Delivery unit.
    Both the two authorized relevant InfoObjects are used in the query.
    In the query we have used a two authorization variables.
    Now only values in the authorizations are checked where Organizational responsible are true AND Delivery unit are true.
    Is it possible to check the authorization where:
    Organizational responsible is true OR Delivery unit is true??
    Please help!
    Regards,
    Jos.

    Hi,
    hmmm Andreas, I must comment on that:
    what is required is to show any record having Object1 = True OR Object2 = TRUE.
    Logically it is the same than asking:
    Don't show records having (Object1 NOT True) AND (Object2 NOT True), correct me if I am wrong there (this is pure Boolean math...)
    Because BW doesn't support this it doesn't mean that ANY system cannot do it.
    Simply put with SQL
    SELECT * FROM TABLE
    WHERE OBJ1 = TRUE OR OBJ2 = TRUE works perfectly in ANY RDBMS.
    also
    SELECT * FROM TABLE
    WHERE NOT OBJ1 <> TRUE AND OBJ2 <> TRUE would work as well.
    It is just that BW always perform an AND when you filter two different objects.
    Jos could achieve what he wants by setting up some restricted key figures and work it out with conditions but definitively not with standard authorizations.
    Alternatively, as I already mentioned, compounding objects would work but not without modeling effort. Finally I believe that with user exits it would also be possible... I don't have time but I would as well investigate bringing both objects along with the provider in a multi and verify if that couldn't be done by semi/standard means finally...
    hope this shed some lights on the issue....
    regards,
    Olivier.

  • Comparing two ResultSets for equality

    Hello,
    I wish to test if two separate ResultSet objects are identical.
    By identical I mean that two different ResultSet objects are identical if
    they contain the same rows in the same order, and each row contains identical values in the two ResultSets.
    Two possibilities could be that the equals() method returns true or that the hashcode() method also produces the same hash value if the objects are identical as described.
    I haven't been able to find any documentation on this issue.
    Does anyone know if either (or both) of these methods have the contract as described above? If so are they guaranteed?
    I can see several potential problems here. Performance with a large ResultSet, duplicate rows, and the ordering of rows not being guaranteed?
    Thanks in advance.
    Tim

    Two possibilities could be that the equals() method
    returns true or that the hashcode() method also
    produces the same hash value if the objects are
    identical as described.I can tell you without looking anything up that these methods do not do that, as doing that would require them to scan the entire result-set, and JDBC tries to avoid doing useless processing. You are going to have to write this code yourself.

  • 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

Maybe you are looking for

  • How can this encoding be saved in SQL Server 2008

    hi all, We are using Sql Server 2008, it has this collation set "SQL_Latin1_General_CP1_CI_AS". Please have a look at this file: https://drive.google.com/file/d/0BxWAyvJA9ZjCdkFNN3BXZUw3dEE/view?pli=1 its a text file in text format (ascii test data f

  • New ipod touch does not have firmware 2.0

    I ordered my ipod touch on July 17th, after the firmware release but still have the older firmware. Am I still supposed to pay for the firmware update? I have no idea whom to pose this question to at apple. Any ideas/thoughts?

  • Buffalo LinkStation Live and NasNavigator 2 problems with Mac

    I am using a Buffalo LinkStation Live (LS-CH1.0TL) with my MacBook. With the Firewell turned off on my Mac it works really well. Unfortunately, with the Firewall on, a perpetual dialogue box appears asking to give permission to allow incoming connect

  • Question about domain name/JSP, servlets

    I have a web host which publishes my pages, say www.zzz.com. I want to use JSP/Servlets on my machine which is using Apache Tomcat. Here's the problem, if I link a JSP/Servlet from www.zzz.com, the user will see my IP, i.e. 37.28.18.102/servlets/Calc

  • Converting cDAQ voltage input to PSI using Y=MX B formula

    Hello - I have been tasked with writing a VI that will take in the input from 16 different Sensor-Technik Pressure Transmitters (model A08) and converting them into a readable output in the form of an on-screen gauage. This is my first expierence wit