Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Check out the qtns for Part I

 
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
HI ....
Check out these !!!

1. An applet will directly accesses Database using
JDBC. No database installation (or) configuration is
to be perform on client workstations which JDBC driver
used in this situation.
a) Type-1 JDBC-ODBC Bridge Driver
b) Type-2 Native API partly Java Driver
c) Type-3 JDBC-Net pure Java Driver
d) Type-4 Native protocol pure Java Driver
e) Type-5 Standard internet driver
2. Which is true in Container Managed Persistent(CMP)
Enterprise bean.
a) Container managed fields must be declared as Public
b) The Primary Key can be defined at deployment time.
c) The SQL for any finder methods is stored in the Deployment Discriptor
d) Fields to table mapping information is stored in Deployment Discriptor

3. Dynamic access to remote CORBA objects is obtained by client side
applications via
a) location directory
b) implementation repository
c) object registry
d) naming server directory
e) interface respiratory

4. Which of the method names of ejb avail thru' JNDI
a) register()
b) put()
c) bind()
d) store()
e) insert()

5. Select the distributed object protocol from following.
a) RPC
b) CORBA
c) RMI-IIOP
d) RMI-JRMP

6. A "Singleton" is a design pattern, which states
that a class has only one instance, with global access
to it, Given an Order Entity EJB, which of the
following is a Singleton
a) Orderitem
b) OrderBean
c) OrderRemote
d) Order

7. Which middle ware solution is BEST fit when
anonymously accessing the server under the firewalls
of Internet.
a) RMI
b) Servelets
c) CORBA
d) EJBs

8.A reference to an EJB can be stored by a client for later use by:
a) serializing the EJBObject to disk
b) Adding the object to the server's pooled objects
c) implementing a find for the bean
d) storing the Handle of the EJB for the bean object

9. What manner a developer define asynchronous method in CORBA
a) outKeyword in IDL
b) asynchronousKeyword in IDL
c) nowaitKeyword in IDL
d) onewayKeyword in IDL
e) any one method of a void return types,does only
input parameters and throws no exceptions.

10.A developer successfully creating and tests a stateful bean following deployment, intermittent
"NullpointerException" begin to occur, particularly when the server is hardly loaded. What most likely
to related problem.
a) setSessionContext
b) ejbCreate
c) ejbPassivate
d) beforeCompletion
e) ejbLoad

11. 2 programs are there- and running concurrently.
Both will select multiple rows from the table. No
table updates can occur while the 2 programs are
running. Which isolation can provide BEST performance
while priventing conflicts?
a) TRANSACTION-NO
b) TRANSACTION-READ-UNCOMMITTED
c) TRANSACTION-READ-COMMITTED
d) TRANSACTION-REPEATABLE-READ
e) TRANSACTION-SERIALIZABLE
Vidya
 
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
1. An applet will directly accesses Database using
JDBC. No database installation (or) configuration is
to be perform on client workstations which JDBC driver
used in this situation.
a) Type-1 JDBC-ODBC Bridge Driver
ODBC driver must be installed on the machine
and the ODBC data source must be already configured !!
b) Type-2 Native API partly Java Driver
Only trusted applet can load libraries and these libraries need to be installed
on the client.
c) Type-3 JDBC-Net pure Java Driver
Types 3 and 4 are closely related. Both are written in 100% pure Java
and so do not have to be installed on the client
but can instead be downloaded by a web browser as required.

d) Type-4 Native protocol pure Java Driver
Like a Type 3 driver, a Type 4 driver is written in 100% pure Java
and does not need to be installed on client machines.
e) Type-5 Standard internet driver
This is wrong as there is not such driver as this.
answer c) d)
2. Which is true in Container Managed Persistent(CMP)
Enterprise bean.
a) Container managed fields must be declared as Public
b) The Primary Key can be defined at deployment time.
c) The SQL for any finder methods is stored in the Deployment Discriptor
d) Fields to table mapping information is stored in Deployment Discriptor

answer : a,b d

3. Dynamic access to remote CORBA objects is obtained
by client side applications via
a) location directory
b) implementation repository
c) object registry
d) naming server directory
e) interface respiratory

You have to the CORBA CosNaming service via JDNI (naming)
answer d)

4. Which of the method names of ejb avail thru' JNDI
a) register()
b) put()
c) bind()
d) store()
e) insert()

Look at InitialContext API http://java.sun.com/j2se/1.3/docs/api/javax/naming/InitialContext.html
answer c)
5. Select the distributed object protocol from following.
a) RPC
Usually, RPC is not well-suited for applications
involving distributed objects or object-oriented programming.
b) CORBA
is a specification
c) RMI-IIOP
d) RMI-JRMP
Java RMI (Remote Method Invocation) is a distributed object model
for the Java Platform using either JRMP or RMI-IIOP protocols.
c) d) are correct
6. A "Singleton" is a design pattern, which states
that a class has only one instance, with global access
to it, Given an Order Entity EJB, which of the
following is a Singleton
a) Orderitem
b) OrderBean
c) OrderRemote
d) Order
I don't think these question is really clear.
First of all, the notion of Singleton in the context of EJB is confused.
In a distributed system, singleton are not unique , only in a particular VM.
what is orderitem and order in these question ?
7. Which middle ware solution is BEST fit when
anonymously accessing the server under the firewalls
of Internet.
a) RMI
b) Servelets
c) CORBA
d) EJBs
Usually, Anonynous means Browser-based client ....
A anonymous client will use mainly HTTP protocol...so the suitable answer is servlet !!
answer b)

8.A reference to an EJB can be stored by a client for later use by:
a) serializing the EJBObject to disk
b) Adding the object to the server's pooled objects
c) implementing a find for the bean
d) storing the Handle of the EJB for the bean object

A handle is the best choice to obtain a reference to the EJB Object.
answer a)

9. What manner a developer define asynchronous method in CORBA
a) outKeyword in IDL
b) asynchronousKeyword in IDL
c) nowaitKeyword in IDL
d) onewayKeyword in IDL
e) any one method of a void return types,does only
input parameters and throws no exceptions.
All is wrong here !!!
To make an asynchronous method in Corba, you have first to use
a specific IDL compiler option.
The compiler will generate specific stubs and skeletons and add new
callback method whose the first argument is simply the return value.
These method returns "void"
If I have to choose one answer .....I will choose e) due to the "void return type".
10.A developer successfully creating and tests a stateful bean following deployment,
intermittent "NullpointerException" begin to occur, particularly when the server is hardly loaded.
What most likely to related problem.
a) setSessionContext
b) ejbCreate
c) ejbPassivate
d) beforeCompletion
e) ejbLoad
I guess it is once again a vendor-specific question.
When the application server will throw a NullpointerException ?!!!

I will answer c) when the ejb container try to passivate a NULL sessionContext...
11. 2 programs are there- and running concurrently.
Both will select multiple rows from the table. No
table updates can occur while the 2 programs are
running. Which isolation can provide BEST performance
while priventing conflicts?
a) TRANSACTION-NO
b) TRANSACTION-READ-UNCOMMITTED
c) TRANSACTION-READ-COMMITTED
d) TRANSACTION-REPEATABLE-READ

e) TRANSACTION-SERIALIZABLE

No update means no needs to write, so no Phamton read...
the defaut is isolation level is TRANSACTION-READ-COMMITTED.
answer c)
 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
herve
I have few comments about your answers .

1. "Select the distributed object protocol from following" (5th question)
there is no protocol like RMI-JRMP. So, is this a correct answer in this case?.
2. "10.A developer successfully creating and tests a stateful bean following deployment, intermittent "NullpointerException" begin to occur, particularly when the server is hardly loaded.
What most likely to related problem. "
The question says, the server is not yet loaded. So, it may be in the process of creating the bean pool. In which case, it will call the setSessionContext, and in case an error occurs it will thorw an exception.
All other options will come into picture once the client calls the create method on the bean. So my answer is (A)

 
Iyengar Srividya76
Ranch Hand
Posts: 87
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi Herve....
I agree with venkata.....
1. "Select the distributed object protocol from following" (5th question)
there is no protocol like RMI-JRMP. Java RMI uses JRMP protocol for performaing c/s communications. For 5th qtn I think the ans is c....
Regarding the 10th qtn... I think again venkata is right... but anyways will have to have another opinion....
-----------------------------------------------------------------
Here are some of the other qtns....
An EJB client has no current transaction. It invokes the business method of an
EJB using container-managed transaction demarcation.
The business method executes within the scope of a transaction.
Which of the following are possible values for the bean method's transaction attribute?
a)NotSupported
b)Supports
c)Required
d)RequiresNew
e)Mandatory
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
ans is c and d
d)RequiredNew :- if there is a transaction already runnning the transaction is suspended
otherwise a new transaction is started
c) Required :- Required to be used when a bean has to always run in a transation.
If a transaction is already running then the bean joins it
else a new transaction is started
Which one of the following statements describes the design that BEST leverages the J2EE architecture?
a)Clients install Swing components on their system which interact via RMI with EJBs on the server, EJBs interact with
backend services such as databases.
b)Clients view applets in web browsers, servlets service the client requests on the server and interact with backend
services such as databases.
c)Clients view HTML in web browsers, JSP pages service the client requests and interact with EJBs on the server,
EJBs interact with backend services such as databases.
d)Clients view HTML in web browsers, CGI scripts service the client requests on the server and interact with EJBs on
the server, EJBs interact with backend services such as databases.
Single Select - Please select the best answer (one and only one choice must be selected).
This one is obvious.
C

An instance of the Person class, whose definition is given below, is returned from a remote method invocation in RMI.
An exception is thrown. Why?
public class Person extends Object {
private String name;
public String getName()
{
return name;
}
public String setName(String newName)
{
name = newName;
}
}
a) Person does not implement the java.io.Serializable interface
b) Person does not implement the RemotePerson interface
c) The class was not precompiled with rmic
d) The class does not extend java.rmi.server.UnicastRemoteObject}
Single Select - Please select the best answer (one and only one choice must be selected).
The answer is a. To be passed via RMI the class, and its components, must be serializable.

Two programs, ProgramA and ProgramB, access the same database table concurrently. Both programs connect to the
database with a transaction isolation level of TRANSACTION_READ_COMMITTED. ProgramA begins a multiple row update but
has not yet committed its changes. At the same time ProgramB selects a row that has been modified by ProgramA. What
happens?
a) ProgramA receives an SQLException
b) ProgramB receives an SQLException
c) ProgramB reads the row and continues
d) ProgramB blocks until ProgramA commits or rolls back
e) A deadlock occurs
D is the right answer. B will block. READ_COMMITTED prevents B from reading data that another program may be updating.
Since A and B both are marked as TRANSACTION_READ_COMMITTED, will read only committed data
ie will eliminate dirty read. And since the program A has begun it's update and
not committed yet and at the same time program B selects a row that A has modified
but not committed, will not read be B. Program will have to wait until the Program A
committs or rollsback.

Most web applications require logic for validating form input and determining the
next page to display. Given long term maintenance and reuse objectives,
what is the BEST design to implement this logic?
a) A JSP that both validates form input and determines the next page.
b) Validate form input in a JSP and determine the next page in a servlet.
c) Validate form input in a servlet and determine the next page in a JSP.
d) A servlet both validates form input and determines the next page.
Single Select - Please select the best answer (one and only one choice must be selected).
Can someone say the answer for this one and also the xplanation for the same !!

Which of the following is true concerning the use of UserTransaction?
a) Stateless Session beans must start and end a UserTransaction within one method, since they service multiple
clients.
b) Stateful Session beans must start and end a UserTransaction within one method, since they service multiple
clients.
c) A UserTransaction for stateless Session beans can span methods, since they service only one client.
d) A UserTransaction for stateful Session beans can span methods, since they service only one client.
I pick a & d.
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
A developer is using a DBConnectionPool to work with a database. While running, a DBException is thrown.
What are possible causes?
a) The pool has reached its maximum number of connections and cannot create more.
b) No maximum was specified for the pool
c) The pool needs to be reinitialized
d) The pool was not initialized

I pick d
In deployment descriptors, security roles and method permissions:
a) can be shared across EJBs.
b) can utilize wildcard characters to authorize multiple methods at one time.
c) can be defined during deployment.
d) are mapped to actual user groups during deployment.
I pick b, c
a is ruled out ... method permissions cannot be shared..
Multiple Select - Please select all of the correct answers (this question has 3 correct choices).
public synchronized void fixMe()
{
Sysmtem.out.println("EJB prohibits the use of synchronized keyword");
}
a) The method will run
b) Run time error after ejbCreate()
c) compile time error for remote interface
d) Run time error when the method is executed
e) compile time error for bean implementation class
I pick c but e seems to be the correct answer to.

Vidya
1. An applet will directly accesses Database using
JDBC. No database installation (or) configuration is
to be perform on client workstations which JDBC driver
used in this situation.
a) Type-1 JDBC-ODBC Bridge Driver
This is ruled out as this requires ODBC configuration on client machine.
b) Type-2 Native API partly Java Driver
this is also ruled out as applet cannot access native code.
c) Type-3 JDBC-Net pure Java Driver
This is correct as the driver is dynamically downloaded
d) Type-4 Native protocol pure Java Driver
This is ruled out for the reason mentioned for b.
e) Type-5 Standard internet driver
This is wrong as there is not such driver as this.
 
herve attia
Ranch Hand
Posts: 138
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator

Originally posted by venkata pochinapeddi:
herve
I have few comments about your answers .

1. "Select the distributed object protocol from following" (5th question)
there is no protocol like RMI-JRMP. So, is this a correct answer in this case?.


RMI-JRMP or RMI/JRMP or RMI(JRMP) means "RMI over JRMP" ...JRMP stands for "Java Remote Method Protocol" for Java Remote Method Invocation (RMI)...
Even SUN uses "RMI-JRMP" expression...check it out...;-)
http://developer.java.sun.com/developer/onlineTraining/J2EE/Intro/
 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
To best leverage the J2EE architecture JSP pages should contain as little of Java code as possible. It should display the interface and service the request by POSTing to a servlet which uses the session parameters.
About the long term maintenence and a web app that needs to validate input the above applies. The JSP should be all HTML if possible to allow web site developers to concentrate on the look of the page instead of Java code. If (D) implies that a JSP page shows the interface and the input posts to a servlet for processing that should be correct.
[This message has been edited by Shaun Gray (edited October 27, 2001).]
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Report post to moderator
Hi Iyengar Srividya76,
Please post a single question in a single thread. This is the standard Javaranch Policy. Your earlier thread which was posted has been transfered to the Moderators Only forum as there were some questions from the Actual Exam. I had asked this to be done. I will ask this thread be closed and requst you to please follow this policy of " One Question per thread".
Thanks.

------------------

Mahindrakar
IBM Application Server Forum Moderator

Consultant - Zensar Technologies ,Pune India.
SCJP2, SCJD2 & SCJEA (Part I)
 
Now I am super curious what sports would be like if we allowed drugs and tiny ads.
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
    Bookmark Topic Watch Topic
  • New Topic