The above command extracts all the sample files to TransactionSample
folder. Click here to view the directory
structure and description of sample files.
Configuring the
Application
Preparing the Database:
This sample application uses two schemas namely Travel
and Car_Dealer .
1. Ensure that 'Travel Schema' is loaded into the database. For more details
about loading the Travel Schema Click here.
2. For installing Car_Dealer schema follow the steps below:
Connect to the database as SYSTEM user. Default
password for SYSTEM user is MANAGER
Run the install.sql script file located in <SAMPLE_HOME>/TransactionSample/database
directory
This creates a schema named car_dealer\car_dealer and
populates it with the tables required by application and the sample data.
Deploying and Running
the Application
The application can be deployed and
run in either of the following ways:
Deploying and Running the application using
Oracle9i JDeveloper
This section describes the steps required for deploying and
running this application using Oracle9i JDeveloper.
Step 1:. Open the <SAMPLE_HOME>/TransactionSample/TransactionSample.jws
in Oracle9i JDeveloper. The workspace contains TransactionSample.jpr
(project file), Servlet files and other files.
Step 2: Create Database Server Connection for
travel Schema
Select Database Server under the Connections Node.
Right click on Database Servers and select "New Connection".
In Step 1 of the wizard, enter the Connection Name as
'Travel'.
In Step 2 of the wizard, provide 'travel' as user name
and password for the travel schema. (by default travel).
In Step 3 of the wizard, provide the appropriate database
connection information where travel schema is loaded.
In Step 4 of the wizard, test the connection and Select
'Finish' button
Step 3: Create Database Server Connection for
Car Schema
Select Database Server under the Connections Node.
Right click on Database Servers and select "New Connection".
In Step 1 of the wizard, enter the Connection Name as
'Car'.
In Step 2 of the wizard, provide 'car_dealer' as user
name and password for the car_dealer schema.
In Step 3 of the wizard, provide the appropriate database
connection information where car_dealer schema is loaded.
In Step 4 of the wizard, test the connection and Select
'Finish' button
Step 4: Right click TransactionSample.jpr and select
"Make TransactionSample.jpr". This compiles all the java classes in the project.
Step 5: Right click TransactionSample.jpr and
select "Run TransactionSample.jpr". This opens up the browser and runs
the HotelServlet.
Deploying and Running
the application using ANT
This section describes the steps required in deploying this
application to the Standalone OC4J using ANT Tool.
Step 1: SET Environment Variables
Open the Command Prompt and Go to the <SAMPLE_HOME>/TransactionSample
directory
Ensure that JAVA_HOME environment variable is
pointing to your JDK installation directory
Ensure that <JAVA_HOME>/bin is in the PATH
Ensure that <ANT_HOME>/bin is in the PATH
Step 2: Modify the host name, database listening
port and database sid attributes of <SAMPLE_HOME>/TransactionSample/config/data-sources.xml
according to your own database settings.
Step 3: Build the EAR file
From <SAMPLE_HOME>/TransactionSample, execute
ant
<SAMPLE_HOME>/TransactionSample
> ant
This will create the TransactionSample.ear file.
Step 4: Ensure that OC4J is up and running. To start the OC4J server,
navigate to <J2EE_HOME> and execute the following command.
java -jar oc4j.jar
Step 4: Having created a TransactionSample.ear file,
to deploy this application to Standalone OC4J use the following command, from
<SAMPLE_HOME>/TransactionSample directory.
where, <host_name> is the machine on which OC4J is
running and <port> is Port to which the OC4J server listens to HTTP requests.
By default OC4J listens for HTTP requests in port # 8888.
The sample is provided as a jar file TransactionSample.jar
that contains the following files required for the sample. They get extracted
in TransactionSample directory.
Directory
File
Description
TransactionSample
build.xml
Ant build script
TransactionSample/docs
Readme.html
This file
TransactionSample.jws
Oracle9i JDeveloper works space file
TransactionSample.jpr
Oracle9i JDeveloper project file
TransactionSample/config
application.xml
This file is used to define the J2EE EAR
file, which contains the location of EJB JAR file, Web application WAR file
and is included in the EAR file
data-sources.xml
This file contains application specifc datasource
definition. This is included in the EAR file
orion-application.xml
This file used ot define orion specific configuration settings. This
file contains reference to application specific data-sources.xml. This
is included in the EAR file
TransactionSample/src/META-INF
ejb-jar.xml
This file is used to define the EJB deployment
descriptors and is included in the EJB JAR file
orion-ejb-jar.xml
This file is used to define the orion specific
EJB deployment
descriptors and is included in the EJB JAR file.
This java file is the servlet client for
the HRS application and contains methods which contains calls to the HotelInformation
EJB & ReservationAgent EJB
EJBHotelServletHTML.java
This java file has all the method's for generating
the HTML text for display on the browser
TransactionSample/src/web/images
logo.gif
HRS logo image
Calendar
Calendar image
TransactionSample/src/web/WEB-INF
web.xml
This file is used to define the Web deployment
descriptors and is included in the WAR file
TransactionSample/src/web
Calendar.txt
Calendar java script file
TransactionSample/database
install.sql
SQL file required for creating
car_dealer schema.
Please enter your comments about this sample application
here.