Local and remote interfaces for flexible EJB use (ii)

Source: Internet
Author: User

Set up a project in application Developer

Step 1. Creating data models and persistent storage

The data model for Dual applications is the same as in the "Hello World" Java application. First enter DB2, then create a database named Dualdb, and then create a table person in the database:

CREATE TABLE PERSON
   (
   ID
   INTEGER NOT NULL PRIMARY KEY,
   FIRSTNAME VARCHAR(40),
   LASTNAME
   VARCHAR(40)
   )

This script is provided in the TABLE.DDL of the downloaded ZIP file.

Step 2. Create a project

In this step, we will create a set of projects in which each of the projects will be used for different purposes. For example, we will place entity beans and session beans in different jars because larger Java EE applications are often made up of several jars or projects. Please create the following items one after another:

A.java Project: DualJavaModule00. In this project, create the package dual.value. We will put the class person of VO into it.

B.J2EE 1.3 Project: Dualearforallinone. This project will be a placeholder for the all-in-one topology.

C.J2EE 1.3 Project: Dualearforejbcontainer. This project is intended to be used only as an EJB container.

4.J2EE 1.3 Project: Dualearforweb. This item is intended to be used only as a Servlet container. In addition, we can use Dualearforallinone to achieve the same goal, because the only difference between them is Project dependencies. However, it is best to keep them separate.

5.EJB 2.0 Item: DUALEJBMODULE01. associated with Dualearforejbcontainer. Create the package DUAL.EJB (in the Ejbmodule folder).

6.EJB 2.0 Item: DUALEJBMODULE02. associated with Dualearforejbcontainer. Similarly, create a package dual.ejb. Make this project dependent on DUALEJBMODULE01. (Dependencies will be further introduced later.) )

7.Web Project: DualWebModule03. When you create this project, select the Advanced options check box to relate it to dualearforweb. Create a package Dual.servlet within this WEB project. Do not select all the webproject features because this exercise does not require them.

After the initial project structure has been completed, the Java EE view in the Workbench should look like Figure 3.

Figure 3. A workbench with a project

In the project Navigator view, you can see all the items you have created.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.