File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Oracle/OAS and the fly likes Problem with detailcriteria in 9i Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Problem with detailcriteria in 9i" Watch "Problem with detailcriteria in 9i" New topic

Problem with detailcriteria in 9i

Dany Thivierge

Joined: Jun 21, 2002
Posts: 6
Hi there!
We used to have this code running fine in 8i in a JSP file:
objViewObject = objAppModule.findViewObject("menu_view");
objViewObject.setWhereClause("Utilisateur.ID_UTILISATEUR = ?");
objViewObject.setWhereClauseParam(0, strIdUtilisateur);
<jsp:useBean id="XSLTProcesseur" class="drioq.XmlExt.XmlDataExt" scope="request">
XSLTProcesseur.initialize(application, session , request, response, out, "infogen_InfoGen_app.menu_view");
That was running fine (returning the view menu_view with the query change to the one we set in the "setWhereClause". But now that we run this on 9i it dosent run well... Now it run the menu_view without the "setWhereClause" so it return all the row and not only those that we want.
Did anyone seen this kind of problem?
Thank for the help guys.
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Before it actually runs the query, have you done a System.out.println to see the query it is going to run? does it have the where clause in it.
I am thinking it doesn't happen because of Oracle, but is in the class code.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Dany Thivierge

Joined: Jun 21, 2002
Posts: 6
Thanks Mark for the repply,
Yes i've check the query and it dosent contain the where clause... lok like the XSLTProcesseur.initialize(application, session , request, response, out, "infogen_InfoGen_app.menu_view");
dosent use the things set in the objViewObject.setWhereClause("...") It was working fine before we migrate to 9i... look at what i've found in the class XmlDataEXT:
/* Slightly changed version of XmlData , in order to support customization
* of detail views while rendering.
* The change consist in changing the type of the xrr attribute from
* XmlRowSetRenderer to XmlRowSetRendererExt , also a custom class that
* looks for a criteria on the session context.
* The value name should be of the form
* <view_name>_DetailCriteria
* Example: myViewName_DetailCriteria
* The clause should not contain bind variables. ( The overcrowding of the
* pool might be prevented by using the CURSOR_SHARING=FORCE setting in the
* init.ora file)
* A second change consists in adding a call to the setSession method of
* the mentioned xrr attribute, in the body internalInitialize method
* ALSO, pay attention that the JSP application needs to be STATE-LESS in order
* for the where clause on the the master query, ( dealt with by the DataWebBeanImpl
* class) to work
I dont quite understand what it is but we are using a custum class (made by Oracle back in 1999). And now it seem not to use the same "magic" to run...
Any help will be appreciate!
Thanks again!
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

Well the best I could help you with is regarding using Java to construct a query and run it and get results back.
I am currently working on a simple Servlet that the user enters Project Number and region, selects HTML or PDF, then clicks a button.
The servlet takes the parameters, makes the query (with where clause based on parameters), runs the query against Oracle, translates the resultSet to XML, then with an XSL document transform it into HTML, and with a different XSL:FO document transform then have FOP return PDF to the Browser.
Here's my Java code for Oracle.

now the getSQL and getData are called by a seperate method as in

This uses a helper class to take the ResultSet and translate it into XML.
Hope this can help you. It looks like you need to rewrite those classes that uses the object that was "Magic" before. Hopefully things weren't too coupled together. If it is look at it as an opportunity to de-couple and refactor so you never find yourself in the same position.
Good Luck
Dany Thivierge

Joined: Jun 21, 2002
Posts: 6
Thanks again Mark!
But as we are migrating an old applicatin (in 8i) it is not an option to redo all our JSP. We need to use the BC4J view object and application.initialise and rendre to ouput our XML-XSl. We plan to redo all the product in OC4J but later...
we are still open to get some help!
see ya
SJ Adnams
Ranch Hand

Joined: Sep 28, 2001
Posts: 925
I really feel like hijacking this thread into "top 10 ways to optimize Mark's code".
I agree. Here's the link:
subject: Problem with detailcriteria in 9i
It's not a secret anymore!