Dive into Oracle ADF

Send me a mail
 Dive into Oracle ADF   Click to see the XML version of this web page.   (Updated: 2/3/2008; 8:11:45 PM.)
Tips and tricks from Steve Muench on Oracle ADF Framework and JDeveloper IDE

Search blog with Google:
 

Search BC4J JavaDoc:
 

January 2003
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  
Dec   Feb

Get Firefox!

Thursday, January 23, 2003

"How can I invoke a stored procedure before a view object query executes?"

The framework class oracle.jbo.server.ViewObjectImpl has a method executeQueryForCollection() which will be invoked by the framework to actually execute the query for the view object to produce the resulting RowSet. If you override this method in your view object's custom ViewObjectImpl subclass, you can write a method like this:

protected void executeQueryForCollection(Object qc,
                                         Object[] params,
                                         int noUserParams) {
/*
* Use getDBTransaction().createCreateCallableStatement()
* to create a JDBC callable statement to invoke the
* stored procedure first, then call the super to do the
* framework's built-in behavior.
*/
super.executeQueryForCollection(qc, params, noUserParams);
}

10:40:02 AM    



© Copyright 2008 Steve Muench.