This week's book giveaway is in the Server-Side JavaScript and NodeJS forum.
We're giving away four copies of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques and have Mario Casciaro & Luciano Mammino on-line!
See this thread for details.
Win a copy of Node.js Design Patterns: Design and implement production-grade Node.js applications using proven patterns and techniques this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply 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
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

interesting j2ee questions, please help urgent !!

 
Ranch Hand
Posts: 334
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
14)
An EJB business method performs an operation that throws a checked exception. The bean cannot
recover from this checked exception and should rollback. The bean will be deployed using
container-managed transaction demarcation. Which implementation is the BEST?

a) public void businessMethod() { try { // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae) { throw new EJBException(ae); } }

b) public void businessMethod() { try { // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae) { context.setRollbackOnly(); throw new EJBException(ae); } }

c) public void businessMethod() throws EJBException { try { // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae) { throw new EJBException(ae); } }

d) public void businessMethod() throws EJBException { try { // operation throwing SomeCheckedException goes here }
catch (SomeCheckedException ae) { context.setRollbackOnly(); throw new EJBException(ae); } } }

Single Select - Please select the best answer (one and only one choice must be selected).
my answer - b)
12)
Which of the following are true regarding BMP Entity beans?

a) Persistent fields can be declared private.

b) The ejbFindByPrimaryKey() method returns void.

c) Finder methods are implemented at deployment time.

d) A record should be inserted into the database during ejbCreate().
Multiple Select - Please select all of the correct answers (this question has 2 correct choices).
my answer - a), d)
6)
A servlet counts the number of times it has been called using an incrementCount() method.
During testing, the developer verifies that the servlet accurately counts the requests from
a number of clients. Which of the following BEST explains this fact?
a) The web or application server supports activation and passivation of the servlet.

b) The HttpServlet class is designed to share state data across all its instances.

c) The same servlet instance services all the requests.

d) The servlet doGet( ) method has been marked as synchronized.
my answer - a)
5)
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
my answer - b)
4)
Which of the following statements accurately describe the J2EE architecture?

a) Web components provide presentation logic that works well with anonymous clients over the Internet.

b) EJBs provide business logic within the context of transactions and persistence.

c) Web components access EJBs through the same APIs as application clients.

d) Application servers provide the infrastructure for the J2EE architecture.

Multiple Select - Please select all of the correct answers.
my answer - a), b), d)
Thanks in advance
Ruilin
 
We don't have time for this. We've gotta save the moon! Or check this out:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic