Appendix A.3 Order of executing the sample project
(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.
- From the Eclipse menu bar, choose Window - Preferences.
The Preferences dialog box appears.
- In the left pane of the Preferences dialog box, choose Server - Runtime Environment.
The Server Runtime Environment page appears.
- Click the Add button.
The New Server Runtime dialog box appears.
- 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.
- From the Eclipse menu bar, choose File - Import.
The Import dialog box appears.
- 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.
- Select the Select archive file checkbox, and then click the Browse button.
The Select archive containing the projects to import dialog box appears.
- 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 |
- 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.
- In the Project Explorer view, choose the Bank project.
- From the Eclipse menu bar, choose Project - Properties.
The Property: Project-name dialog box appears.
- In the left pane of the Property: Project-name dialog box, choose Target Runtimes.
The Target runtime page appears.
- 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:
- The embedded database must be running.
If the embedded database is not running, from the Start menu, select Program - Cosminexus - Start Database, and then start the embedded database.
- The Cosminexus server is in the stopped state.
In the Server view, make sure that InstantJ2EEServer at localhost is in the Stopped status. If InstantJ2EEServer at localhost is in the Running status, select InstantJ2EEServer at localhost, and then in the View toolbar, click
(Stop) to stop the Cosminexus server.
- 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.
- 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" |
- 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.
- From the Eclipse menu bar, choose File - New -Other.
- In the New dialog box, choose Server - Server, and then click the Next button.
- In the New Server dialog box, choose Cosminexus - J2EE server, and then click the Next button.
- 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.
- Check InstantJ2EEServer, and then click the Finish button.
Cosminexus J2EE server is created.
(6) Executing the sample project (Bank)
Execute the sample project (Bank).
- 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.
- 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.