INTERVIEW QUESTIONS
J2EE
EJB
DETAILS
Question: Write a basic structure of an EJB session bean class.
Answer: //import statements public class SampleSessionBean implements SessionBean { public SampleSessionBean() { super(); // TODO }
public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException { // TODO }
public void ejbRemove() throws EJBException, RemoteException { // TODO }
public void ejbActivate() throws EJBException, RemoteException { // TODO }
public void ejbPassivate() throws EJBException, RemoteException { // TODO }
public void ejbCreate() throws CreateException { // TODO }
public void businessMethod() throws Exception { // Business logic }
public Object businessMethod1(Arg 1, Arg 2) throws Exception { // Business logic }
|
Question:
Write a basic structure of an EJB session bean class.
Answer:
//import statements public class SampleSessionBean implements SessionBean { public SampleSessionBean() { super(); // TODO }
public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException { // TODO }
public void ejbRemove() throws EJBException, RemoteException { // TODO }
public void ejbActivate() throws EJBException, RemoteException { // TODO }
public void ejbPassivate() throws EJBException, RemoteException { // TODO }
public void ejbCreate() throws CreateException { // TODO }
public void businessMethod() throws Exception { // Business logic }
public Object businessMethod1(Arg 1, Arg 2) throws Exception { // Business logic } Source: CoolInterview.com
Answered by: Binu | Date: 4/26/2009
| Contact Binu
//import statements public class SampleSessionBean implements SessionBean { public SampleSessionBean() { super(); // TODO }
public void setSessionContext(SessionContext ctx) throws EJBException, RemoteException { // TODO }
public void ejbRemove() throws EJBException, RemoteException { // TODO }
public void ejbActivate() throws EJBException, RemoteException { // TODO }
public void ejbPassivate() throws EJBException, RemoteException { // TODO }
public void ejbCreate() throws CreateException { // TODO }
public void businessMethod() throws Exception { // Business logic }
public Object businessMethod1(Arg 1, Arg 2) throws Exception { // Business logic } Source: CoolInterview.com
Answered by: Binu | Date: 4/26/2009
| Contact Binu
If you have the better answer, then send it to us. We will display your answer after the approval.
Rules to Post Answers in CoolInterview.com:-
- There should not be any Spelling Mistakes.
- There should not be any Gramatical Errors.
- Answers must not contain any bad words.
- Answers should not be the repeat of same answer, already approved.
- Answer should be complete in itself.
|