SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Stateless Session Beans - Complete Project (Continue...)

 Introduction

To improve performance, you might choose a stateless session bean if it has any of these traits:

  • The bean’s state has no data for a specific client.
  • In a single method invocation, the bean performs a generic task for all clients. For example, you might use a stateless session bean to send an email that confirms an online order.
  • The bean fetches from a database a set of read-only data that is often used by clients. Such a bean, for example, could retrieve the table rows that represent the products that are on sale this month.
Types of Enterprise Beans are
  • Session Beans
    1.  Stateless Session Beans
    2. Stateful Session Beans
  • Entity Beans
    1. Bean Managed Persistent (BMP) Entity Beans
    2. Container Managed Persistent (CMP) Entity Beans
  • Message-Driven Bean
CLICK HERE to download this complete example (zip file)


 Steps to deploy and run this Stateless Session Bean Project

  1. Write a java program and name it as LoanHome.java
  2. Write a java program and name it as Loan.java
  3. Write a java program and name it as LoanBean.java
  4. Write a java program and name it as LoanServlet.java
  5. Write a html file and name it as Loan.html
  6. Set the path in the "command prompt"
    set path=.;D:\progra~1\java\j2sdk1.5.0\bin;D:\Sun\AppServer\bin;
    Set classpath=.;D:\progra~1\java\j2sdk1.5.0\lib;D:\Sun\AppServer\lib\j2ee.jar;
    (OR)
    Set the path in the system itself. CLICK HERE for details
  7. Now compile the LoanHome.java, Loan.java, LoanBean.java, LoanServlet.java. CLICK HERE to see how to compile
  8. After the java programs are compiled successfully, you can close the command prompt.
  9. Now goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Start Default Server (wait till it start and then press any key). CLICK HERE to see how to Start the Server
  10. Next goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Deploytool. CLICK HERE to see how to Start the Deploytool
    Now in the deploytool,
  11. Goto File ->New -> Application

    (Click the Browse button)


  12. (Select the folder in the Look In dropdown box, and then give a file name StatelessBeanExample. Next click the New Application button)


  13. (Click the OK button)
  14. Now goto File -> Save to save the file
  15. Now select File->New->Enterprise Bean command
  16. Click the Next button
  17. Next, click the Edit Contents button
  18. Select only the Loan.class, LoanBean.class, LoanHome.class files and click the Add button
  19. Click the OK button
  20. Click the Next button and then select LoanBean from the Enterprise Bean Class drop-down box, also type LoanBean in the Enterprise Bean Name textbox, select Stateless Session from the Enterprise Bean Types, and then select the LoanHome from the Remote Home Interface, and then select the Loan from the Remote Interface
  21. Click the Next button
  22. Select the No option button and then click the Next button
  23. Click the Finish button

 Click Next To Continue ...
<- PREVIOUSNEXT ->