Explain the difference between, Java Class and Bean?

Answer Posted / john

A Java class is meant to carry out the different database
operations like retrtieveing data, inserting data and
updating data.

The EJB has the business logic within it. the EJB decides
what the business requires and carries out different
transactions. It makes use of the Java class to interact
with the database.

The Java Bean is simple java class which is contains Getters
and Setters. They are just meant to modify the values of the
variables. They neither contain any business logic nor do
they interact with the database.

Generaly a Java Class would retrieve some data and this data
is assigned to variables using the Setter method of the Java
Bean. If we want to retrieve the value of the cariable again
we use a Getter method

Is This Answer Correct ?    22 Yes 16 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are transaction isolation levels in ejb?

761


How do you decide whether you should use session, entity or message driven bean?

811


What is ejb in weblogic?

778


What is enterprise bean provider?

828


What is mdb in ejb?

706


What is stateless and stateful?

753


What is use of @postconstruct?

717


Why is ftp stateful?

739


What is passivation and activation in ejb?

731


Is ejb be called from another ejb? If yes then how?

752


What is EJB server?

776


Who took over ejb?

808


How can a CORBA object, accessed from a EJB?

1917


What is a ejb container?

714


What does it mean to be stateless?

740