Skip to Main Content

Java Development Tools

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

how to access a database View Object (VO) via a Custom Java Classes

910318Jan 11 2012 — edited Jan 11 2012
Hello,

I' m using Oracle JDeveloper 11.2.1.0.

I would like to access a database View Object (VO) via a Custom Java Classes. I take the View Object Wizard to build the VO including the java-Class with binding variables (adf.object.viewObject.xxx)... However, I could not access to the VO java class from a java class in my model.


On "Oracle® Application Development Framework Developer's Guide For Forms/4GL Developers" I found the following Code example.

[Example 5-16 Simple Example of Using Client Row Interface with Accesso|http://docs.oracle.com/cd/B31017_01/web.1013/b25947/bcquerying011.htm] rs

package devguide.examples.client;
import devguide.examples.common.UsersRow;
import oracle.jbo.ApplicationModule;
import oracle.jbo.ViewObject;
import oracle.jbo.client.Configuration;
import oracle.jbo.domain.Number;
public class TestClient3 {
public static void main(String[] args) {
String amDef = "devguide.examples.UserService"; <= ???
String config = "UserServiceLocal"; <= ???
ApplicationModule am =
Configuration.createRootApplicationModule(amDef, config);
ViewObject vo = am.findViewObject("UserList");
vo.executeQuery();
while (vo.hasNext()) {
// Cast next() to a strongly-typed UsersRow interface
UsersRow curUser = (UsersRow)vo.next();
Number userId = curUser.getUserId();
String email = curUser.getEmail();
System.out.println(userId+ " " + email);
}
Configuration.releaseRootApplicationModule(am, true);
}
}

By reading the doc and google, I could not understand how to define the strings 'amDef' and 'config'. Here I need the help from your site.

Is there an other way to get an access to the VO java class?

Thanks and best greetings,
Gerd
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 8 2012
Added on Jan 11 2012
8 comments
1,152 views