View links in oracle ADF/query featching from Database

Please any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname      Loc
15 i1     support     50000     11     5     5     IT          sss
15 i1     support     50000     11     3     3     Account     sss
16 i2     support     8000     10     5     5     IT          sss
16 i2     support     8000     10     3     3     Account     sss
16 i2     support     8000     10     3     3     Software      sss
16 i2     support     8000     10     4     4     Operation      sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1     support 50000     11
Deptno dname      Loc
5     IT          sss
3     Account     sss
This is second row:
Empno ename job Salary Comm
16 i2     support     8000     10
Deptno dname      Loc
5     IT     sss
3     Account     sss
2     Software sss
4     Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanks

Please any one help for this query
I have two tables Emp, Dept
I have query like this select * from Emp e, Dept d where e.deptno=d.deptno
Query is fetching like this
Empno Ename job Salary Comm deptno deptno dname      Loc
15 i1     support     50000     11     5     5     IT          sss
15 i1     support     50000     11     3     3     Account     sss
16 i2     support     8000     10     5     5     IT          sss
16 i2     support     8000     10     3     3     Account     sss
16 i2     support     8000     10     3     3     Software      sss
16 i2     support     8000     10     4     4     Operation      sss
Query is fetching 6 rows.
but my requirement is what ever records fetching from database with same employee number is one record that is same employee number dept names grouped I will show it as one record how to fetch records from data base.
Here is the example (My Requirement):
This is first row:
Empno Ename job Salary Comm
15 i1     support 50000     11
Deptno dname      Loc
5     IT          sss
3     Account     sss
This is second row:
Empno ename job Salary Comm
16 i2     support     8000     10
Deptno dname      Loc
5     IT     sss
3     Account     sss
2     Software sss
4     Operation sss
i am useing oracle ADF if any possibility in view links either i get from the query as i mentioned.
plz any one can help
thanks

Similar Messages

  • How to change the default behaviour of View Object in oracle adf

    Hi,
    I have created a view object from an entity object and placed it as a table with multiple lines on my page.
    When I run my page, by default, it loads all the rows based on the sql in the VO.
    My requirement is when I load my page, I don't want to return any data in that table.
    I am using JDeveloper 11.1.2.4.
    Please can you advise how can I achieve this functionality?
    thanks
    Muhammad

    Hi Shay,
    I've used  the refreshCondition #{bindings.Sku.inputValue ne null} as per your suggestion but getting below error
    <RichExceptionHandler> <_logUnhandledException> ADF_FACES-60098:Faces lifecycle receives unhandled exceptions in phase RENDER_RESPONSE 6
    java.lang.NullPointerException
        at oracle.adf.model.binding.DCExecutableBinding.refreshMasters(DCExecutableBinding.java:265)
        at oracle.adf.model.binding.DCExecutableBinding.refreshIfNeeded(DCExecutableBinding.java:340)
        at oracle.jbo.uicli.binding.JUCtrlHierBinding.getRootNodeBinding(JUCtrlHierBinding.java:90)
        at oracle.jbo.uicli.binding.JUCtrlHierBinding$1JUCtrlHierHintsMap.internalGet(JUCtrlHierBinding.java:210)
        at oracle.jbo.common.JboAbstractMap.get(JboAbstractMap.java:54)
        at oracle.adfinternal.view.faces.model.binding.FacesCtrlHierBinding$1DecoratedHintsMap.internalGet(FacesCtrlHierBinding.java:305)
        at oracle.jbo.common.JboAbstractMap.get(JboAbstractMap.java:54)
        at javax.el.MapELResolver.getValue(MapELResolver.java:164)
        at com.sun.faces.el.DemuxCompositeELResolver._getValue(DemuxCompositeELResolver.java:176)
        at com.sun.faces.el.DemuxCompositeELResolver.getValue(DemuxCompositeELResolver.java:203)
        at com.sun.el.parser.AstValue.getValue(Unknown Source)
        at com.sun.el.ValueExpressionImpl.getValue(Unknown Source)
        at org.apache.myfaces.trinidad.bean.FacesBeanImpl.getProperty(FacesBeanImpl.java:73)
        at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.getProperty(BaseColumnRenderer.java:1195)
        at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.layoutHeader(BaseColumnRenderer.java:643)
        at oracle.adfinternal.view.faces.renderkit.rich.table.BaseColumnRenderer.encodeAll(BaseColumnRenderer.java:152)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at oracle.adfinternal.view.faces.renderkit.rich.table.BaseTableRenderer.layoutColumnHeader(BaseTableRenderer.java:1197)
        at oracle.adfinternal.view.faces.renderkit.rich.TableRenderer.encodeAll(TableRenderer.java:636)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at org.apache.myfaces.trinidad.component.UIXCollection.encodeEnd(UIXCollection.java:617)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
        at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeFormItem(PanelFormLayoutRenderer.java:1127)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.access$100(PanelFormLayoutRenderer.java:50)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1604)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer$FormColumnEncoder.processComponent(PanelFormLayoutRenderer.java:1523)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
        at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer._encodeChildren(PanelFormLayoutRenderer.java:420)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelFormLayoutRenderer.encodeAll(PanelFormLayoutRenderer.java:208)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer._encodeChild(PanelGroupLayoutRenderer.java:447)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.access$1500(PanelGroupLayoutRenderer.java:30)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:734)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer$EncoderCallback.processComponent(PanelGroupLayoutRenderer.java:637)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:187)
        at org.apache.myfaces.trinidad.component.UIXComponent.processFlattenedChildren(UIXComponent.java:318)
        at org.apache.myfaces.trinidad.component.UIXComponent.encodeFlattenedChildren(UIXComponent.java:283)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelGroupLayoutRenderer.encodeAll(PanelGroupLayoutRenderer.java:360)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at oracle.adf.view.rich.render.RichRenderer.encodeStretchedChild(RichRenderer.java:2194)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer._renderPane(PanelSplitterRenderer.java:1599)
        at oracle.adfinternal.view.faces.renderkit.rich.PanelSplitterRenderer.encodeAll(PanelSplitterRenderer.java:279)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
        at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
        at oracle.adfinternal.view.faces.renderkit.rich.FormRenderer.encodeAll(FormRenderer.java:274)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeChild(CoreRenderer.java:624)
        at oracle.adf.view.rich.render.RichRenderer.encodeChild(RichRenderer.java:3201)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeAllChildren(CoreRenderer.java:641)
        at oracle.adf.view.rich.render.RichRenderer.encodeAllChildrenInContext(RichRenderer.java:3062)
        at oracle.adfinternal.view.faces.renderkit.rich.DocumentRenderer.encodeAll(DocumentRenderer.java:1275)
        at oracle.adf.view.rich.render.RichRenderer.encodeAll(RichRenderer.java:1452)
        at org.apache.myfaces.trinidad.render.CoreRenderer.encodeEnd(CoreRenderer.java:511)
        at org.apache.myfaces.trinidad.component.UIXComponentBase.encodeEnd(UIXComponentBase.java:923)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1681)
        at javax.faces.component.UIComponent.encodeAll(UIComponent.java:1677)
        at oracle.adfinternal.view.faces.component.AdfViewRoot.encodeAll(AdfViewRoot.java:91)
        at com.sun.faces.application.view.JspViewHandlingStrategy.doRenderView(JspViewHandlingStrategy.java:431)
        at com.sun.faces.application.view.JspViewHandlingStrategy.renderView(JspViewHandlingStrategy.java:233)
        at org.apache.myfaces.trinidadinternal.application.ViewDeclarationLanguageFactoryImpl$ChangeApplyingVDLWrapper.renderView(ViewDeclarationLanguageFactoryImpl.java:350)
        at com.sun.faces.application.view.MultiViewHandler.renderView(MultiViewHandler.java:131)
        at javax.faces.application.ViewHandlerWrapper.renderView(ViewHandlerWrapper.java:273)
        at org.apache.myfaces.trinidadinternal.application.ViewHandlerImpl.renderView(ViewHandlerImpl.java:165)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._renderResponse(LifecycleImpl.java:1035)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl._executePhase(LifecycleImpl.java:342)
        at oracle.adfinternal.view.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:236)
        at javax.faces.webapp.FacesServlet.service(FacesServlet.java:509)
        at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
        at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300)
        at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adf.model.servlet.ADFBindingFilter.doFilter(ADFBindingFilter.java:173)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.adfinternal.view.faces.webapp.rich.RegistrationFilter.doFilter(RegistrationFilter.java:125)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at oracle.adfinternal.view.faces.activedata.AdsFilter.doFilter(AdsFilter.java:60)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl$FilterListChain.doFilter(TrinidadFilterImpl.java:468)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl._doFilterImpl(TrinidadFilterImpl.java:293)
        at org.apache.myfaces.trinidadinternal.webapp.TrinidadFilterImpl.doFilter(TrinidadFilterImpl.java:199)
        at org.apache.myfaces.trinidad.webapp.TrinidadFilter.doFilter(TrinidadFilter.java:92)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.security.jps.ee.http.JpsAbsFilter$1.run(JpsAbsFilter.java:119)
        at java.security.AccessController.doPrivileged(Native Method)
        at oracle.security.jps.util.JpsSubject.doAsPrivileged(JpsSubject.java:315)
        at oracle.security.jps.ee.util.JpsPlatformUtil.runJaasMode(JpsPlatformUtil.java:442)
        at oracle.security.jps.ee.http.JpsAbsFilter.runJaasMode(JpsAbsFilter.java:103)
        at oracle.security.jps.ee.http.JpsAbsFilter.doFilter(JpsAbsFilter.java:171)
        at oracle.security.jps.ee.http.JpsFilter.doFilter(JpsFilter.java:71)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at oracle.dms.servlet.DMSServletFilter.doFilter(DMSServletFilter.java:139)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27)
        at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:178)
    any ideas please?

  • View Link Editor Issue - empty query clause if based on association

    JDeveloper 10.1.2
    Setup:
    - entities A and B
    - a 1 to * association from entity A to entity B (A_B_association)
    - a view of A based on entity A (AView)
    - a view of B based on entity B (BView)
    - BView has an expert mode query
    Create a view link from table A to table B:
    - choose the A_B_association under AView for the source attribute
    - choose the A_B_association under BView for the destination attribute
    - click add
    - click next
    issue: the query clause is empty
    - click next:
    info dialog pops up;
    title = "Business Components"
    message = "Restoring the default where clause."
    Note, however, that creating a view link based on the attributes works. That is, if I choose the primary key attribute under AView for the source attribute, and the corresponding foreign key attribute under BView for the destination attribute, then the wizard generates the expected query clause.
    If I create a new project and recreate the entities, the views, and the association, then I can successfully create a view link based on the association. The foreignKey value on the association end was different in the new association XML file.  I modifed the old XML file so that it used the same foreignKey element, but that did not seem to work.
    I am guessing that this is some sort of user error on my part or that we have otherwise managed to squat up our XML files.
    Any tips, hints, or ideas appreciated.
    Thanks,
    Steve

    The problem is in AView.
    We had modified the AView at one point, then reverted it to a default view of entity A. Here, "a default view" means that we undid our custom changes (apparently not thoroughly enough); that is, we did not delete it and create a default view from scratch using the contextual menu on the A entity.
    The bottom line is that the AView attributes were not being mapped to the entity -- they were showing up as calculated attributes.
    We created a "New Default View Object..." from the contextual menu of entity A, then manually corrected the AView.xml file to solve the problem.

  • SQL query or view used internally by Discoverer Open Workbook from Database

    Hi Experts,
    I am involved in developing a web application wherein I have to display the 'All Workbooks' similiar functionality in the 'Open Workbook from Database' dialog box of Discoverer. Can anybody provide me with the background query or view that Discoverer uses to retrieve this data for workbook listing? Please let me know if my question is confusing and requires more details.
    Thanks
    Thomas

    Hi,
    If you just need the list of workbooks then you need to use the EUL_DOCUMENT table:
    SELECT u.User_Name          Owner_Name
    *,Doc.Doc_Name Workbook_Name*
    *,Doc.Doc_Updated_Date Last_Update_Date*
    FROM   Eul_Us.Eul5_Documents Doc
    *,Eul_Us.Eul5_Eul_Users Own_Usr*
    *,Fnd_User u*
    WHERE  Own_Usr.Eu_Id = Doc.Doc_Eu_Id AND
    To_Char(u.User_Id(+)) = Substr(Own_Usr.Eu_Username
    *,2*
    *,10);*
    If you want the exact same list then you need to do the above along with the sharing :
    SELECT DISTINCT
    case when instr(disco_docs.doc_created_by,'#')=0 then disco_docs.doc_created_by
    when instr(disco_docs.doc_created_by,'#')>0 and instr(disco_docs.doc_created_by,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_docs.doc_created_by,2,5))
    else NULL
    end "Workbook Owner/Creator",
    disco_docs.doc_name "Workbook Name",
    disco_docs.Doc_Updated_Date  "Last Update Date",
    case when instr(disco_users.eu_username,'#')=0 then disco_users.eu_username
    when instr(disco_users.eu_username,'#')>0 and instr(disco_users.eu_username,'#',2)=0 then (select fu.user_name from fnd_user fu where fu.user_id=substr(disco_users.eu_username,2,5))
    else (select resp.responsibility_name from fnd_responsibility_tl resp where resp.responsibility_id=substr(disco_users.eu_username,2,5))
    end as "Shared Name / Responsibility"
    FROM
    eul_us.eul5_documents disco_docs,
    eul_us.eul5_access_privs disco_shares,
    eul_us.eul5_eul_users disco_users
    WHERE
    disco_docs.doc_id = disco_shares.gd_doc_id (+)
    and disco_users.eu_username(+) NOT IN ('EUL5', 'PUBLIC')
    AND disco_users.eu_id(+) = disco_shares.ap_eu_id;
    * Change the EUL_US to your discoverer schema...
    Then you will need to compare the current user with the sharing list or creator
    Good luck
    Tamir

  • Best Practice on querying Data from Database

    Hello and I was wondering what is the preferred and best practice for querying data from an SQL database inside a JSP page. Is it using the JSTL library or another method? Thanks

    It depends on the size of the application really.
    The "correct and preferred" approach in a large MVC app would be to have a seperate class that does all the database access, retrieving the data into java objects.
    Check out [url http://java.sun.com/blueprints/corej2eepatterns/Patterns/DataAccessObject.html] DAO pattern
    You then "save" the data into request/session attributes, and forward to a jsp page to render the result.
    Most approaches recommend a separation between JSP (the view) and SQL code.
    The JSTL sql tags are provided more for "quick and dirty" code applicable in small applications, or for fast prototyping. That approach is not really robust for large scale applications.
    Cheers,
    evnafets

  • Urgent:-how to open an seperate webpage on clicking on a link in oracle adf

    My requirement is after clinking on a command link in adf: <af:commandLink text="View Rate Scedule " id="cl1"
    </af:commandLink>, it should open any URL in a separate window that is passed to it... version used is j dev11g.. plz help

    use goLink
    http://jdevadf.oracle.com/adf-richclient-demo/docs/tagdoc/af_goLink.html

  • Dead Link in "Oracle ADF: Tutorial for Forms/4GL Developers"

    In "Oracle Application Development Framework: Tutorial for Forms/4GL Developers (10.1.3.1.0)"
    URL: http://www.oracle.com/technology/obe/ADFBC_tutorial_1013/10131/index.htm
    link "Download the zipped support files" returns "We're sorry, the page you requested was not found."
    URL: http://download.oracle.com/otndocs/products/jdev/10131/ADFBCTutorialSetup10131.zip

    In "Oracle Application Development Framework: Tutorial for Forms/4GL Developers (10.1.3.1.0)"
    URL: http://www.oracle.com/technology/obe/ADFBC_tutorial_1013/10131/index.htm
    link "Download the zipped support files" returns "We're sorry, the page you requested was not found."
    URL: http://download.oracle.com/otndocs/products/jdev/10131/ADFBCTutorialSetup10131.zip

  • Oracle JAAS with roles from database tables and Oracle SSO integration

    I have the following requirement for user authentication and authorization. The applications are build using ADF Faces and BC4J. User authentication should be done using Oracle SSO. User roles and functions will be stored in custom tables. These roles will be used on ADF application pages to restrict access to the UI components on a page. Example: User will "Employee" role cannot create a new employee; however, user with "HR" role can create a new employee.
    In this case, "Create" button will be visible on the ADF page.
    1. How can we use Oracle JAAS to use custom tables for roles instead of using flat XML files?
    2. How does ADF applications use these roles to restrict components on a page?
    3. For authentication, I guess we should be able to use SSO and integrate with Oracle JAAS?
    Thanks.

    Hi,
    I can give you the answers to 1 and 2 but haven't tried 3.
    1) Oracle OC4J since 10.1.3.1 has a database LoginModule that is explained in the OC4J security guide.
    I have a how-to document in review that will be published probaby next week and that explains how to set this LogiNModule up for JDeveloper and stand alone OC4J, though the OC4J documentation is pretty good as well
    http://download-west.oracle.com/docs/cd/B32110_01/web.1013/b28957/loginmod.htm#BABCDDAI
    2) Create a managed bean with boolan methods like isUserManager, isUserEmployee, isUserTechnician etc. In this methods check for the security role on teh request object's isUserInRole() method. Then access this methods from the disabled or rendered property using ExpressionLanguage
    A custom Login ModuleDoesn't use Oracle JAAS but plugs into it. So I am not sure if SSO would work with this because the custom LoginModule wouldn't get a username password pair but only a username that it has to trust.
    Frank

  • ADF: Display image from database

    Hi,
    I've found a number of threads addressing this issue, but none that have solved my problem as yet. I'm trying to display an image from a database column in JDev 10.1.3.2.0. I've found an article in the Help that sounds like it's describing exactly what I need:
    To insert a databound image control into a form or panel: In the ADF Swing project, open the Java Visual Editor on the desired data panel or form. From the View menu choose Data Control Palette to open the palette. In the Data Control Palette, drag the attribute you want to bind to the image control into the open form or panel. From the Add Child popup list, select JUImageControl. JDeveloper adds code to the class file to bind the JUImageControl to the attribute
    The problem I'm having is that this doesn't bear any relation to what I can see. I'm presuming that the Java Visual Editor is the design tab of the jsp page editor, as this is the only visual editor I can find. If it isn't, that would explain why this doesn't work... When I drag my attribute, I have to select what type of item I want it to be. I can't find an Add Child popup anywhere.
    I have a horrible feeling that this is a very stupid question, but I'm completely stuck.

    The help-text you found refers to an ADF-Swing project, not a web application with JSP's. This post: How to display the content of a BLOB column in a ADF/BC pages ? shows you how to do it with ADF Faces.

  • How to query data from database and store it into Managed Bean ?

    Hi all,
    In our application we have requirement to store information within Managed Bean to be accessed by ADF pages.
    The information is stored in database tables.
    The question is :
    What is the efficient / recommended way to do that ?
    I do not use apps module to query the data because the information is required in View layer not the model layer
    Thank you for your help,
    xtanto

    Xtanto,
    if the information is stored in the database then the question is if there is a database connect open already. If yes, then why not using this connection to query for the data you want to access and store. Alternatively you can directly open a JDBC connection in a managed bean or access an EJB session bean. However, this comes with the price of an extra database connection.
    Make sure the managed bean is in session scope if you want to share the information without re-fetching it
    Frank

  • Urgent! How to insert into and query video from database in forms???

    In forms 6i demos CD, There is a demo form ocxvideo.fmb,
    but it just for video in file system.
    I want to read *.avi file from file system, and insert into
    database, and query from my forms.
    I create table with long raw, with default forms wizard,
    long raw for [image] item in forms.
    I change item type to ActiveX ,and right_click mouse
    ==>[Insert object]==>Oracle Veideo control.
    still can not insert avi data into database and query from my forms.
    Please give me some advice to solve this problem?
    Thank you very much!
    Ming-An
    [email protected]

    In forms 6i demos CD, There is a demo form ocxvideo.fmb,
    but it just for video in file system.
    I want to read *.avi file from file system, and insert into
    database, and query from my forms.
    I create table with long raw, with default forms wizard,
    long raw for [image] item in forms.
    I change item type to ActiveX ,and right_click mouse
    ==>[Insert object]==>Oracle Veideo control.
    still can not insert avi data into database and query from my forms.
    Please give me some advice to solve this problem?
    Thank you very much!
    Ming-An
    [email protected]

  • How to drop  EM Oracle Enterprise Manager component from database.

    We have database that somebody used in past as EM Grid repository. This no longer in use. Looking for documentation on how to drop it. If somebody knows please provide me with link to appropriate Oracle document.
    Oracle version 11gR1.
    Thanks.

    I suspect that if you cannot locate the instructions on the proper way to remove EM that you can drop the owning repositiry user sysman from the database then cleanup any database parameters related to EM.
    I would think the place to start would be the EM (Grid Control) installation manual for your version of Oracle and platform.
    10g List of install manuals
    http://otn.oracle.com/pls/db102/drilldown?levelnum=2&toplevel=b31288&method=LIKE&chapters=0&book=&wildcards=1&preference=&expand_all=&result_id=&verb=Installing&word=enterprise+manager#b31288
    HTH -- Mark D Powell --

  • Query Data From Database and set Visibility Accordingly

    Hi there,
    i have a case where i have to set the rendered property of some items on my screen according to values retrieved from an sql statement.
    When i change a value in a listbox, that value must be given to an sql statement as a parameter (select field_id fom table where id = the value in the list box) to query the ids of the fields from a database table . (each id of a field in my jsf page has the same value in that database table).
    For each record retrieved in that query, the field's rendering having that id must turn to false.
    Anyone can give me a solution to my urgent problem ? ( Where do i write the select statement and the loop and how ... )

    Hi,
    what comes to my mind is to create a custom version of HashMap (extend HashMap) and override the get method. The configure this custom Hashmap as a managed bean. Usually you cannot pass arguments in EL, but for HashMaps this is doable by overriding the get method (at least I remember having done this before).
    So in your EL rendered property value you do
    #{managedHashMapBean["nameOfFieldId"]
    In the bean you just check if the ID exists and if it doesn't return true. So all that your query needs to do is to populate the internal state of the hashmap with the IDs that should be false.
    Frank

  • Having problem querying data from database

    I'm trying to setup a query form to see if the username and password entered is already in a database. If it is then a Static Text will give a positive message, if not then the user would be asked to register. My query doesn't seem to work, since every time I run it the Static Text doesn't show anything after I hit my submit button. Any help would be great.
    public String loginButton_action() {
    // TODO: Process the action. Return value is a navigation
    // case name where null will return to the same page.
    String currentuser = (String) regusernameTF.getValue();
    String currentpass = (String) regpasswordTF.getValue();
    try {
    connection = DriverManager.getConnection(Database_URL);
    statement = connection.createStatement();
    ResultSet resultset = statement.executeQuery(
    "SELECT Username ,Password FROM CustomerInfo" +
    "WHERE (Username =' " currentuser " ') ");
    connection.commit();
    statement.close();
    connection.close();
    String loggeduser = resultset.getString(1);
    String loggedpass = resultset.getString(2);
    boolean compare1 = loggeduser.equals(currentuser);
    boolean compare2 = loggedpass.equals(currentpass);
    if ((compare1==true) || (compare2==true)){
    messageST.setRendered(true);
    messageST.setText("Login Successful");
    else {
    messageST.setRendered(true);
    messageST.setText("Username & Password not Valid." +
    "Please Check Entry or Register to Login");
    catch (Exception e){
    e.printStackTrace();
    return null;
    Edited by: mavrik5150 on Feb 9, 2008 4:49 PM
    Edit: Forgot to mention the Database does have data already populated into it

    Hey Thanks guys for the tips, I was able to fix one problem, now I can get the Static Text field to display a message but I can't get the error message to appear when I purposly enter a wrong password or username. If I enter a correct username I get a successful message, even when I enter the wrong password. Here's the fixed code:
        public String loginButton_action() {
            // TODO: Process the action. Return value is a navigation
            // case name where null will return to the same page.
            Object currentuser =  regusernameTF.getValue();
            Object currentpass =  regpasswordTF.getValue();
            try {
            connection = DriverManager.getConnection(Database_URL);
            statement = connection.createStatement();       
            ResultSet resultset = statement.executeQuery(
                    "SELECT Username ,Password FROM CustomerInfo WHERE (Username ='"+currentuser+"') ");       
    //        connection.commit();
    //        statement.close();
    //        connection.close();   
            while (resultset.next()){
            String loggeduser = resultset.getString("username");
            String loggedpass = resultset.getString("password");
            boolean compare1 = loggeduser.equals(currentuser);
            boolean compare2 = loggedpass.equals(currentpass);
            if (compare1 || compare2){
                messageST.setRendered(true);
                messageST.setText("Login Successful");
            else {
                messageST.setRendered(true);
                messageST.setText("Username & Password not Valid." +
                        "Please Check Entry or Register to Login");
            catch (Exception e){
                e.printStackTrace();
            return null;
        }

  • Problems querying view link

    I have created a query page that uses a view link do a query. No rows are returned. However, their are several rows in both tables that are represented in the view link.
    Below is the code from the JSP.
    &lt;%@ page
    language="java"
    errorPage="errorpage.jsp"
    contentType="text/html;charset=windows-1252" %&gt;
    &lt;%@ page language="java" import = "oracle.jbo.html.*" %&gt;
    &lt;%@ taglib uri="/webapp/DataTags.tld" prefix="jbo" %&gt;
    &lt;%@ include file="ValidateCookie.inc" %&gt;
    &lt;html&gt;
    &lt;head&gt;
    &lt;META NAME="GENERATOR" CONTENT="Oracle JDeveloper"&gt;
    &lt;LINK REL=STYLESHEET TYPE="text/css" HREF="/webapp/css/bc4j.css"&gt;
    &lt;TITLE&gt;Query From&lt;/TITLE&gt;
    &lt;/head&gt;
    &lt;body&gt;
    &lt;jbo:ApplicationModule id="am"
    configname="XPA.XPAModule.XPAModuleLocal"
    releasemode="Stateful" /&gt;
    &lt;jbo:DataSource
    id="ds"
    appid="am"
    viewobject="View_Cu"
    rangesize='&lt;%=XPA.XPAConstants.XPA_RANGE_SIZE%&gt;'/&gt;
    &lt;%--jbo:DataSource
    id="ds"
    appid="am"
    viewobject="LV_Cu_Contact"
    rangesize='&lt;%=XPA.XPAConstants.XPA_RANGE_SIZE%&gt;'/--%&gt;
    &lt;jbo:DataHandler appid="am"
    relativeUrlPath = "/components/XPADataHandlerComponent.jsp" /&gt;
    &lt;%
    String params = HtmlServices.getRequestParameter(pageContext,"jboEvent");
    params= params + "xx";
    if (params.equalsIgnoreCase("nullxx")) {
    %&gt;
    &lt;%-- Roll back any un-finished transactions. We need to do this in any
    %-- first level jsp to negate any uncommited transactions
    --%&gt;
    &lt;jbo:RollBack appid="am" /&gt;
    &lt;h3&gt;Company Search Page&lt;/h3&gt;
    &lt;a href="queryhelp.html"&gt;Search Help&lt;/a&gt;
    &lt;jbo:DataQuery datasource="ds"
    relativeUrlPath="/components/XPADataQueryComponent.jsp" /&gt;
    &lt;%
    %&gt;
    &lt;jbo:OnEvent list="Search, FirstSet, NextSet, PreviousSet, LastSet" &gt;
    &lt;h3&gt;Query Results&lt;/h3&gt;
    &lt;table border="0"&gt;
    &lt;tr&gt;
    &lt;td ALIGN="left"&gt;
    &lt;jbo:DataScroller datasource="ds" /&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;tr&gt;
    &lt;td&gt;
    &lt;jbo:DataTable datasource="ds"
    relativeUrlPath="Step1DataTableComponent.jsp"
    edittarget="Step1Q_Edit.jsp" /&gt;
    &lt;/td&gt;
    &lt;/tr&gt;
    &lt;/table&gt;
    &lt;/jbo:OnEvent&gt;
    &lt;/body&gt;
    &lt;jbo:ReleasePageResources /&gt;
    &lt;/html&gt;
    Any ideas on how to fix this problem?

    Has the view object been execute? Try using the RefreshDataSource tag.

Maybe you are looking for