wood burning stoves*
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 Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Oracle/OAS
Bookmark "Problem with detailcriteria in 9i" Watch "Problem with detailcriteria in 9i" New topic
Author

Problem with detailcriteria in 9i

Dany Thivierge
Greenhorn

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");
XSLTProcesseur.initialize(pageContext,"infogen_InfoGen_app.menu_view");
XSLTProcesseur.setReleaseApplicationResources(true);
XSLTProcesseur.setStylesheet("/xsl/my.xsl");
XSLTProcesseur.render();
%>
</jsp:useBean>
-------------------------------------------
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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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.
Mark


Perfect World Programming, LLC - Two Laptop Bag - Tube Organizer
How to Ask Questions the Smart Way FAQ
Dany Thivierge
Greenhorn

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
ranger
Sheriff

Joined: Feb 05, 2001
Posts: 17249
    
    6

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
Mark
Dany Thivierge
Greenhorn

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: http://aspose.com/file-tools
 
subject: Problem with detailcriteria in 9i
 
Similar Threads
InstantiationException
bean-related standard actions exercise
HFSJ Page 356, Page 416
jsp:useBean related doubt
question from java black belt?