Introduction to Library Operations Using EJB Java Project:
Enterprise Java Bean (EJB) is a server-sided component, used for modular construction of enterprise applications. EJB encapsulates the business logic of an application. EJB was originally developed in 1997 by IBM, later adopted by Sun Microsystems. EJB provides a standard way to implement the back-end business code found in enterprise applications. EJB handle some common concerns or responsibilities such as: persistence, transactional integrity and security in a standard way.
EJB provides the following responsibilities:
- Transaction processing
- Concurrency Control
- Asynchronous Method invocation
- Job scheduling
- Naming and directory services (JNDI)
- Remoting using web services
- Deployment of software components in an application server.
Library operations need to be developed using Enterprise Java Bean (EJB), the procedure for the development are:
- First we need to import the required packages
- Next create remote interfaces for bean, and name the remote interface as lib Remote. Declare methods such as issue(), return(), with a return type.
- Next step is to create a home interface with a name lib Home, and create method within that with two arguments as stud id and book id, and return type is lib Remote interface that throws create exception and Remote exception.
- Next create a Bean class with a name lib Bean implementing the session bean issue(), now compare the book id and bid in the array, if the status is zero, book can be issued. If status is not zero, then that particular book is not available to be issued and same will be updated in the array, results are returned to the client.
- All abstract method are added to the session Bean, in EJB pass Sid and bid are created.
- Now create client class as LibClient, and import the entire required package, within the try block enclose the code for:
II. Object creation for initial context
III. JNDI is used to lookup a reference to object return type, and create method can be assigned to the remote interface object.
IV. Now call the method in session bean: issue(), return().
V. Result will be displayed in client side.
Download Library Operations Using EJB Java Project Report .