This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
Hi, Let me explain what am I try to do with EJBs here. I have to get 3 values from 2 tables, SAY PRODUCT TABLE AND CUSTOMER TABLE (AS AN EXAMPLE) Customer table has 2 fields, Customer_ID( Primary key) and CustName PRODUCT TABLE has three fields, ProductName, Desc and CustID(which is a foreign key)[This table doesnt have a PK] I am getting productname, desc and custName from the two tables where CustID is the same. So, this can be done with the simple SQL statement. select b.PRODUCTNAME, B.DESC, A.CUST_LISTED_NAME FROM PRODUCTS B, CUSTOMER A WHERE A.CUSTOMER_ID = '11111' Now I want to create two EJBs and select this custName, or findByCustID How do I approach this situation. Which is the best way ? Any suggestions are welcome Thanks, Maya
Sigh. I DO so hate "best". It oversimplifies. There's no such thing as a "best" sort algorithm, only "best" for the data at hand and the environment you're running in. Run a heapsort on nearly ordered data against a bubble sort and tell which is "best". Same for J2EE. About the only "best" I can give you is that if you want to treat 2 tables as a unit, then control them with a unitary object. This can be a Session EJB, a servlet helper class, or, if you're into Struts, an Action helper. I might choose any of the above or something completely different depending on the requirements of the project and what framework I was using.
Customer surveys are for companies who didn't pay proper attention to begin with.