To create the Employee schema follow the steps below
:
1.
In Sql*Plus, Login to your Oracle9i Database using a user with sysdba
privilege. For ex:
sqlplus> connect
sys/change_on_install@db_alias as sysdba;
2.
Then, create a new user with the required privileges using the following
commands in Sql*Plus :
sqlplus> CREATE
USER empinfo IDENTIFIED BY empinfo;
sqlplus> GRANT
connect,resource TO empinfo;
3.
Then, login as the user created above from Sql*Plus and run the script
Employee.sql under the EmployeeInformation/sql directory extracted
above. For example :
sqlplus> @<your_directory_path>\EmployeeInformation\sql\Employee.sql
This script will create all the tables, constraints, sequence and
triggers required for the application.
Setting
up XSQL Pages with OC4J
To setup XSQL pages with OC4J, first extract the
XDK for Java utility downloaded earlier(refer to required
software section) to a convenient directory. This directory will
be referred as XDK_HOME. Then, follow the instructions
below :
1.
Copy the oraclexsql.jar, xmlparserv2.jar,
xdb.jar and xsu12.jar archives from the XDK_HOME
directory to the OC4J_HOME\j2ee\home\lib directory.
2.
Copy the XSQLConfig.xml file in the C:\xdk\xdk\admin
directory to the OC4J_HOME\j2ee\home\lib directory.
3.
Setting up the database connection for XSQL Pages : To setup
the database connection,
a) Edit the XSQLConfig.xml file in the OC4J_HOME\j2ee\home\lib
directory and add the following connection information within
the
<connectiondefs>...</connectiondefs> tags :
<connection name="otn9i">
<username>username</username>
<password>password</password>
<dburl>jdbc:oracle:thin:@hostname:port:sid</dburl>
<driver>oracle.jdbc.driver.OracleDriver</driver>
</connection>
where,
username - is the
name of the database user created above i.e empinfo
password
- is the password of the empinfo user i.e empinfo
hostname - is the hostname
of the machine where Oracle 9i database is running.
port - is the port on the hostname
where the database listener is listening to.
sid - is the sid of your database.
Note : Do not change the Connection name "otn9i"
as this is used in all the XSQL pages of the application.
b) Make sure that in the same XSQLConfig.xml
file edited in step a, the value for the <factory> tag inside
<connection-manager>...</connection-manager> tags
is set to the default value i.e oracle.xml.xsql.XSQLConnectionManagerFactoryImpl
4.
Edit the global-web-application.xml file under
the OC4J_HOME\j2ee\home\config directory and include
the following tags within the <web-app> tag :
<servlet>
<servlet-name>xsql</servlet-name>
<servlet-class>oracle.xml.xsql.XSQLServlet</servlet-class>
</servlet>
<servlet-mapping>
<servlet-name>xsql</servlet-name>
<url-pattern>/*.xsql</url-pattern>
</servlet-mapping>
Save the File.
5.
After performing the above steps, restart the OC4J server.