uCosminexus Application Server, Application Development Guide

[Contents][Glossary][Index][Back][Next]

Appendix A.3 Order of executing the sample project

The sample project provided by Developer can be used as a tutorial for J2EE application development in Eclipse. The tutorial deals with the following functionality:

  1. Starting Eclipse
  2. Creating a server runtime#
  3. Importing the sample project (Bank)
  4. Creating a table
  5. Creating a J2EE server#
  6. Executing the sample project (Bank)

#
When you start Eclipse and InstantJ2EEServer at localhost is displayed in the Server view, this procedure is not required.
Organization of this subsection
(1) Starting Eclipse
(2) Creating the server runtime
(3) Importing the sample project (Bank)
(4) Creating a Table
(5) Creating a J2EE server
(6) Executing the sample project (Bank)

(1) Starting Eclipse

Start Eclipse by executing eclipse.exe in the Eclipse installation directory.

Note
If you are using Windows 8, Windows 7, or Windows Vista as the OS, start Eclipse with the Administrator Privilege mode.

(2) Creating the server runtime

Create the server runtime to operate the J2EE server with Eclipse.

Note that if InstantJ2EEServer at localhost is already displayed in the Servers view, this procedure is not required.

  1. From the Eclipse menu bar, choose Window - Preferences.
    The Preferences dialog box appears.
  2. In the left pane of the Preferences dialog box, choose Server - Runtime Environment.
    The Server Runtime Environment page appears.
  3. Click the Add button.
    The New Server Runtime dialog box appears.
  4. On the New Server Runtime Environment, choose Cosminexus - Cosminexus J2EE, and then click the Finish button.
    The server runtime used to operate the J2EE server with Eclipse is created.

(3) Importing the sample project (Bank)

Import the sample project (Bank) into the workspace of Eclipse.

  1. From the Eclipse menu bar, choose File - Import.
    The Import dialog box appears.
  2. In the Import dialog box choose Select Import Source, and then choose General - Existing Project into Workspace. Then, click the Next button.
    The Import Project page appears.
  3. Select the Select archive file checkbox, and then click the Browse button.
    The Select archive containing the projects to import dialog box appears.
  4. In the Select Archive Containing the Project to be imported dialog box, select the following file, and then click the Open button.
    Developer-installation-directory\ADP\samples\Bank.zip
  5. In the Import Project page, select all items within the Project area, and then click the Finish button.
    The sample project (Bank) will be imported into the Eclipse workspace.
    Note
    When creating a server runtime, if you change the J2EE server runtime name from default, you must change the target runtime of the project.
    1. In the Project Explorer view, choose the Bank project.
    2. From the Eclipse menu bar, choose Project - Properties.
      The Property: Project-name dialog box appears.
    3. In the left pane of the Property: Project-name dialog box, choose Target Runtimes.
      The Target runtime page appears.
    4. Select the created target runtime check box, and then click OK.
      The target runtime is changed.

(4) Creating a Table

In the embedded database built with Development Environment Instant Setup, create a table to be used in the sample project (Bank). Create the table as per the following procedure.

Before creating the table, confirm the following states:

  1. In the Project Explorer view, select BankDBBatch - bank_tblcreate.bat, and then in the context menu, choose Open from Application - Text Editor.
    The bank_tblcreate.bat file will open in the Eclipse text editor.
  2. Revise the authorized identifier and password specified in the bank_tblcreate.bat file to the value set up in Development Environment Instant Setup, and save these values.
    The authorized identifier and password are specified in the fifth and sixth lines of the bank_tblcreate.bat file. Revise the values as follows:
    Line number Before revision After revision
    5 set USER="USER1" set USER="authorized-identifier-specified-in-Development Environment Instant Setup"
    6 set PSWD= set PSWD="password-specified-in-Development Environment Instant Setup"
  3. Select the saved bank_tblcreate.bat file in the Project Explorer view, and then in the context menu select Open from Application - Default Editor.
    The contents of the bank_tblcreate.bat file will be executed, and a table for the sample project (Bank) will be created.
    Reference note
    How to delete the table
    If the table is no longer required, use HiRDB SQL Executer to manually delete the table.

(5) Creating a J2EE server

Create the Cosminexus J2EE server with Eclipse.

Note that if InstantJ2EEServer at localhost is already displayed in the Servers view, this procedure is not required.

  1. From the Eclipse menu bar, choose File - New -Other.
  2. In the New dialog box, choose Server - Server, and then click the Next button.
  3. In the New Server dialog box, choose Cosminexus - J2EE server, and then click the Next button.
  4. On the J2EE server page, choose the connection destination host in Connection Host of Remote Management. If you are not logged in, log in by clicking the Login button.
  5. Check InstantJ2EEServer, and then click the Finish button.
    Cosminexus J2EE server is created.

(6) Executing the sample project (Bank)

Execute the sample project (Bank).

  1. In the Project Explorer view, choose the Bank project, and in the context menu, choose Run as - Run on Server or Debug As - Debug on Server.
  2. In Execute on server or Debug on server dialog box, choose localhost - InstantJ2EEServer at localhost, and then click the Finish button.
    The J2EE server is started, the project is released, and the Web browser is displayed.