JavaBeat Feeds
|
|
|
|
|
|
|
|
|
|
SCBCD Mock Questions - 8
1)Identify how a client can obtain a reference to an existing entity object's remote interface? [Select all correct answers]
1)Invoke the findByPrimaryKey() finder method.
2)Invoke the getHandle() method on the remote interface.
3)Call a create() method on the remote interface.
4)Execute a home business method that returns the reference.
5)Call the getRef() method on the remote interface.
2)How can a client application test whether two entity object references refer to the same entity object?
1)By using the isIdentical() method.
2)By using the == operator.
3)By using the compareTo() method.
4)By using the equals() method.
3)Which of the following declarations for a remote home interface finder method is correct? [Select all correct answers]
1)public Collection findAccounts() throws RemoveException, RemoteException
2)public Collection findIvlAccounts(Date from) throws FinderException, RemoteException
3)public void find(Date from) throws FinderException, RemoteException
4)public Account findAccount(String accNumber) throws FinderException, RemoteException
5)public Account findAccount(String accNumber) throws FinderException
4)Which of the following code fragments will locate an entity bean's remote home interface correctly?
Assume the InitialContext was created and the correct packages has been imported.
InitialContext ctx = new InitialContext();
// set properties
1)PartyHome pHome = (PartyHome) PortableRemoteObject.narrow(ctx.lookup("java:comp/env/parties"),PartyHome.class);
2)PartyHome pHome = (PartyHome) PortableRemoteObject.narrow(ctx.lookup("java:comp/env/parties"));
3)PartyHome pHome = (PartyHome)ctx.lookup("java:comp/env/parties");
4)PartyHome pHome = (PartyHome) PortableRemoteObject.lookup(ctx.narrow("java:comp/env/parties"),PartyHome.class);
5)PartyHome pHome = (PartyHome) PortableRemoteObject.create(ctx.lookup("java:comp/env/parties"),PartyHome.class);
5)How many create() methods can an entity bean's local home interface define?
1)0
2)Exactly 1
3)atleats 1
4)0 or more
5)1 or more
6)Which of the following Exceptions must be included in the throws clause of every create<METHOD> in the following code fragment? [Select all correct answers]
4. public interface PartyHome extends javax.ejb.EJBHome {
5. public Party create(String firstName) throws ...
6. }
1)javax.ejb.FinderException
2)javax.ejb.CreateException
3)java.rmi.RemoteException
4)java.rmi.NoSuchObjectException
5)javax.ejb.NoSuchObjectLocalException
7)Which of the following names can be used to identify legally an entity bean remote home business method? [Select all correct answers]
1)getCustomer
2)createCustomer
3)removeCustomer
4)findCustomer
5)CreateCustomer
8)Which of the following statements are true regarding the narrow() method for an entity bean's home interface?
1)The narrow() method must be used to locate a remote home interface.
2)The narrow() method must be used to locate a local home interface.
3)The narrow() method must be used to locate a local home interface or remote home interface.
4)The narrow() method must be used to lookup in the JNDI space the entity bean.
9)How many create() methods can an entity bean's remote home interface define?
1)0
2)Exactly 1
3)atleast 1
4)0 or more
5)1 or more
10)Which of the following operations on an entity object's local reference are defined in the EJBLocalObject interface? [Select all correct answers]
1)Remove the entity object.
2)Obtain the local home interface for the entity object.
3)Obtain the entity object's primary key.
4)Obtain the entity object's handle.
5)None of the above.
|