Quem souber, responda a esta pergunta que eu encontrei num mock.
Segundo o software do mock eu errei a resposta desta questão, mas acredito que talvez esta questão esteja errada.
Consider the bean code shown in Exhibit. Assuming that there is no deployment descriptor given with the bean, which of the following options can be inserted at //1 without causing any exception? Exhibit:package com.enthu.ejbplus; import java.sql.*; import javax.annotation.Resource; import javax.ejb.*; import javax.sql.DataSource; @Stateless @Remote(com.enthu.ejbplus.TellerRemote.class) @Resource(name="jdbc/ejbplus", type=DataSource.class) public class TellerBean { @Resource SessionContext sctx; public TellerBean() { } public double getBalance(int acctid){ // Line 1 : insert code here } }a) DataSource ds = sctx.lookup("jdbc/ejbplus");
b) Principal p = sctx.getCallerPrincipal();
c) RequestDispatcher rd = sctx.getRequestDispatcher();
d) Context ctx = new InitialContext();
DataSource ds = (DataSource) ctx.lookup("jdbc/ejbplus");
Segundo o software há duas respostas corretas.