SET AS HOME PAGE

ADD TO FAVORITES / BOOKMARK THIS WEBSITE (More Details)

Introduction

Servlet

Jsp

Security

Enterprise Beans

Contact Us


Creating BMP Entity Beans - Project (Continue ...)

 Introduction

To solve the preceding problem, perform the following tasks:
  1. Configure a data source with the J2EE Application Server.
  2. Create the BMP entity bean home interface.
  3. Create the BMP entity bean remote interface.
  4. Create the BMP enity bean class.
  5. Create the Web Client.
  6. Package the BMP entity bean.
  7. Package the Web Client.
  8. Deploy the application.
  9. Test the application.

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 BMP Entity Bean - Project

  1. Write a java file and name it as UserAccountHome.java
  2. Write a java file and name it as UserAccount.java
  3. Write a java file and name it as UserAccountBean.java
  4. Write a java file and name it as UserAccountServlet.java
  5. Write a html file and name it as UserAccount.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 UserAccountHome.java, UserAccount.java, UserAccountBean.java, UserAccountServlet.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. You need to configure datasource with server before deploying. If already configured with server then no need to do again. CLICK HERE to see how to configure datasource with Application Server
  11. Next goto Start -> Programs -> Sun Microsystems ->Application Server PE -> Deploytool. CLICK HERE to see how to Start the Deploytool
    Now in the deploytool,
  12. Goto File ->New -> Application

    (Click the Browse button)


  13. (Select the folder in the Look In dropdown box, and then give a File Name as ejb3. Next click the New Application button)


  14. (Click the OK button)
  15. Now goto File -> Save to save the file
  16. Select File->New->Enterprise Bean
  17. Click the Next button
  18. Now click the Edit button
  19. Now select the UserAccount.class, UserAccountBean.class, UserAccountHome.class and click the Add button
  20. Now click the OK button
  21. Now click the Next button
  22. Now select UserAccountBean from the Enterprise Bean Class drop-down box. Select Entity from the Enterprise Bean Type drop-down box. Select UserAccountHome from the Remote Home Interface drop-down box. Select the UserAccount from the Remote Interface
  23. Now click the Next button
  24. Now select the Bean-Management Persistence from the Persistence-Management Type drop-down box. Also select the java.lang.String from the Select a standard java class option in the Primary Key Class pane
  25. Click the Next button
  26. Click the Finish button

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