Category >
JAVA
|| Published on :
Wednesday, May 13, 2015 || Views:
3314
||
j2ee interview questions and answers for experienced j2ee interview questions pdf j2ee interview questions and answers for freshers pdf java j2ee interview questions and answers for experienced pdf
Question 1.) What Is a Session Bean?
Ans: A session bean represents a single client inside the J2EE server. To access an application that is deployed on the server, the client invokes the session bean’s methods. The session bean performs work for its client, shielding the client from complexity by executing business tasks inside the server. As its name suggests, a session bean is similar to an interactive session. A session bean is not shared–it may have just one client, in the same way that an interactive session may have just one user. Like an interactive session, a session bean is not persistent. When the client terminates, its session bean appears to terminate and is no longer associated with the client.
Question 2.) What is Stateful Session Beans?
Ans: Stateful session beans maintain state information that reflects the interaction between the bean and a particular client across methods and transactions.So, all field variables in the bean instance retain their values as long as the client application retains the bean stub.
Question 3.) Explain EJB?
Ans: An EJB is essentially a software component on which method calls can be made, and which can itself make calls on other components. These calls may be made over a network. In this sense, EJB technology is similar to Java RMI and CORBA. However, there are some defining features of EJBs that make EJB development rather different from (and easier than) other techniques for developing distributed applications. In Version 2.0 of the EJB Specification, EJBs are allowed to interact using local calling semantics, as well as distributed, RMI-like techniques.
Hibernate - Frequently Asked Questions
Question 4.) What is the difference between sorted and orderd collection in hibernate?
Ans: A sorted collection is sorted in-memory using java comparator, while order collection is ordered at the database level using order by clause.
Question 5.) What is HQL?
Ans: Hibernate Query Language
Question 6.) What are the elements in the mapping file?
Ans: The Elements are listed below:
1. Class Element
2. Id Element
3. Generator Element
4. Property Element
Question 7.) What are all the components in Hibernate Architeture?
Ans: Hibernate architecture has three main components
a.Connection Management
b.Transcation Management
c.Object Relational Mapping
Question 8.) What is the advantage of Hibernate over jdbc?
Ans: Hibernate is used to persist the objects in the database, but we have to use the jdbc to connect to database. JDBC is used to store the primitivies in the database
J2EE - Frequently Asked Questions
Question 9.) Difference between forward and send Redirect?
In the case of forward when you invoke a forward request, the request of the user is sent to another resource on the server within the web container, without the client being informed about the process that a different resource is going to process the request. But when a sendRedirtect method is invoked, it causes the web container to return to the browser indicating that a new URL should be requested. For this extra round trip process a redirect is slower than the forward.
Question 10.) What is the difference between ServletContext and ServletConfig?
Ans: ServletContext: Defines a set of methods that a servlet uses to communicate with its servlet container, for example, to get the MIME type of a file, dispatch requests, or write to a log file. The ServletContext object is contained within the ServletConfig object, which the Web server provides the servlet when the servlet is initialized
ServletConfig: The object created after a servlet is instantiated and its default constructor is read. It is created to pass initialization information to the servlet