File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes access records from 2 table using CMB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "access records from 2 table using CMB" Watch "access records from 2 table using CMB" New topic

access records from 2 table using CMB


Joined: Nov 05, 2002
Posts: 5
Hi all
I am doing a project of Health Care. Here in my project I am using weblogic 6.1 as server and I am accessing Surgeon and patient tables from database. In this scenario I want to show the details of a patient as report.This report includes Surgeon details and patient status. I want to achieve using CMP. I hope by using CMP I can get the records either Surgeon or patient. I want to get both table records at a time. Any body tell the approach?
Simon Brown
sharp shooter, and author
Ranch Hand

Joined: May 10, 2000
Posts: 1913
Thanks for joining JavaRanch, but could you just take a quick look at the naming policy and edit your profile.
Also, only members with valid names will be eligible for the book giveaways.
Mary Cole
Ranch Hand

Joined: Dec 02, 2000
Posts: 362
Create a view of those 2 tables and access the view using CMP
Kyle Brown
Ranch Hand

Joined: Aug 10, 2001
Posts: 3892
Most CMP implementations won't work on Views -- they're not updatable.

Kyle Brown, Author of Persistence in the Enterprise and Enterprise Java Programming with IBM Websphere, 2nd Edition
See my homepage at for other WebSphere information.
Sai Prasad
Ranch Hand

Joined: Feb 25, 2002
Posts: 560
Create a Session Facade and find the Surgeon and Patient CMP Entity EJBs using the primary key. You can then form a Data Transfer Object which contains both Surgeon and Patient information specific to your requirement.
Mathews P Srampikal
Ranch Hand

Joined: Nov 26, 2002
Posts: 211
Dear Krish,
If you are using ejb1.1 then it is not possible to use in a single CMP.But if you want show the details of doctor as well as the patient.What you can do is.
1. Create 2 cmp(Doctor and Patient)
2. Make a session bean
3. Using that session bean get the deatils of the Doctor and patient and can be displayed.
Try to use coarse-grained style of Accessing rather fine that you can avoid many network problem.

I agree. Here's the link:
subject: access records from 2 table using CMB
It's not a secret anymore!