Appendix A.1 Overview of the sample project

This section gives an overview of the sample project (Bank) provided by Developer.

Organization of this subsection
(1) Contents of the sample project
(2) Prerequisite environment for the sample project
(3) Configuration of the sample project
(4) Form and storage location of the sample project
(5) Directory configuration of the sample project

(1) Contents of the sample project

The sample project (Bank) provided by Developer is a program that transfers the funds of a user having the User ID entered in the Web browser from a current account (Checking Account) to a savings account (Savings Account). If you enter the user ID and the transaction amount on the displayed window, and then click the Transfer button, the specified amount will be transferred from the current account of the specified user to the savings account. The funds will be managed in the database, and the current account table and savings account table will be updated when the funds are transferred.

The following figure shows the configuration of this sample project (Bank):

Figure A-1 Overview of the sample project (Bank)

[Figure]

In this sample project (Bank), an annotation is used to connect to the database.

The processing will be executed for the specified user ID and amount of money. The following table describes the initial balance that can be specified in 'Bank' for each user ID and the user.

Table A-1 Initial settings of the sample project (Bank)

User IDChecking Account#Savings Account#
00110,000500
00220,0001,000
00330,0001,500
#
The unit of currency used for the amounts shown is Yen.

With the EJB of the sample project, the database is also accessed by acquiring the resource adapter with the @Resource annotation. The specification contents of the @Resource annotation are as follows:

With a servlet (Web container), the EJB will also be accessed by acquiring the EJB with the @EJB annotation. The specification contents of the @EJB annotation are as follows:

Note that the reference name BankEJB specified in the @EJB annotation is defined as follows in the coding of BankEJB:

(2) Prerequisite environment for the sample project

In Appendix A, the procedure for using the sample project (Bank) is described with the following environment as a prerequisite:

(3) Configuration of the sample project

The following projects are provided with the sample project (Bank):

Table A-2 Projects provided with the sample project (Bank)

Project nameSummary
BankThis is an enterprise application project.
Bank_EJBThis is an EJB project. This project is specified in the module project of the sample project (Bank).
Bank_WebThis is a dynamic Web project. This project is specified in the module project of the sample project (Bank).
BankDBBatchThis is a simple project. This project stores the files for creating the tables to be used in the sample project (Bank).

The configuration of the projects provided with the sample project (Bank) is as follows:

[Figure]

(4) Form and storage location of the sample project

Developer provides the sample project (Bank) as an archive file Bank.zip in the zip format. Bank.zip is saved in the following directory:

Developer-installation-directory\ADP\samples

(5) Directory configuration of the sample project

If you unzip Bank.zip in any location, the directory configuration will become as follows:

Table A-3 Directory configuration of the sample project (Bank)

Directory or FileDescription
BankThis is the root of the enterprise application project
EarContentContents folder
META-INFThis directory stores the management information.
application.xmlThis is a DD file
(Deployment descriptor of the J2EE application (EAR))
.projectThis is a project description file
(Stores the information about the Eclipse project)
Bank_EJBThis is the root of the EJB project
ejbModuleThis directory stores the source files
bankThis is a package folder
ejbThis is a package folder
BankEJB.javaThis is a Java source file
(Source code for the EJB project)
BankIF.javaThis is a Java source file
(Source code for the EJB project)
BankItem.javaThis is a Java source file
(Source code for the EJB project)
META-INFThis directory stores the management information.
MANIFEST.MFThis is a manifest file
.classpathThis is a classpath file
(Stores the classpath of the project)
.projectThis is a project description file
(Stores the information about the Eclipse project)
Bank_WebThis is the root of the Web project
srcThis directory stores the source files
bankThis is a package folder
servletThis is a package folder
BankServlet.javaThis is a Java source file
BankServletException.javaThis is a Java source file
WebContentThis is a Web root folder
META-INFThis directory stores the management information.
MANIFEST.MFThis is a manifest file
WEB-INFThis directory stores the files that cannot be accessed directly from a web client.
libThis directory stores the libraries
web.xmlThis is a DD file
(Deployment descriptor of the Web application)
bank.jspThis is a JSP file (The ID and numeric value are entered, and sent to the Servlet)
error_500.jspThis is a JSP file (Displays errors)
index.jspThis is a JSP file (Entrance of the sample project that invokes the servlet)
.classpathThis is a classpath file
(Stores the classpath of the project)
.projectThis is a MyEclipse project file
(Stores the information about the Eclipse project)
BankDBBatchThis is the root of the sample project
bank_tblcreate.batThis is a batch file
(Batch file for creating tables)
Insert_BankTable_
Control_checking
This is a control file
(Control file for the checking table)
Insert_BankTable_
Control_saving
This is a control file
(Control file for the saving table)
Insert_BankTable_
Input_checking
This is a data file
(Data file for the checking table)
Insert_BankTable_
Input_saving
This is a data file
(Data file for the saving table)
tablecreateThis is an SQL file
(Schema definition SQL file for the tables)
.projectThis is a project description file
(Stores the information about the Eclipse project)