LIBRARY OPERATIONS USING EJB



AIM:
To develop an Enterprise Java Bean for Library Operations

PROCEDURE:
1.      Import the required packages.
2.      Create the remote interface for Bean, the name of remote interface is lib Remote, in that declare the methods such as issue (), return (), having int as return type.
3.      Create the Home interface as lib Home having create method with two arguments as stud id and book id returns type is lib Remote interface, that throws create exception and Remote exception.
4.      Create a Bean class as lib Bean that implements the session bean the issue (), we compare both the book id and bid in the array. If in the status is zero, the Book will be issued. If not, it display as that Book is not available and it update in the array. The result will be returned to client. Then add all the abstract method for session Bean. In EJB create pass Sid and bid.
5.      Create the client class as LibClient. Import the entire required package. In try block
·         Write codes for authentication.
·         Create the object for initial context.
·         It uses JNDI to lookup a reference to object return type of create method can be assigned to the remote interface object.
·         Call the method in session bean that is issue (), return ().
·         The result will be displayed in client side.

No comments:

Post a Comment

leave your opinion