Testing the sample application
http://localhost:9080/DatabaseSampleApplication/index.html
Open the following URL if testing in WebSphere Application Server:
|
http://servername:port/DatabaseSampleApplication/index.html
Note: Port is optional depending on your WebSphere Application Server setup. If IBM Http Server (IHS) has been installed along with WebSphere Application Server, configured to use the WebSphere plugin, and the plugin configuration was regenerated during the install of the sample application then :port is not needed. Otherwise, you should specify the HTTP listener port of the application server that is running the sample application, port 9080 is the default port for a single application server install.
|
If Global Security is enabled for the application server, you will be prompted for a valid user ID and password.
|
To test Container-managed authentication to the database, do the following:
|
a.
Select EMPLOYEE from the Table Name list.
|
b.
Select Container from the Authentication Type radio button list.
|
c.
Click Display to show the contents of the Employee table.
|
Note: This test calls the QueryTable servlet with the parameters tableName=EMPLOYEE and auth=Container. The servlet uses the jdbc/sample_container_managed authentication alias to connect to the database and display the table data.
|
d.
Scroll down and click Home to return to the index page.
|
e.
Repeat process for other tables in list if you like.
|
To test Application-managed authentication to the database do the following:
|
a.
Select EMPLOYEE from the Table Name list.
|
b.
Select Application from the Authentication Type radio button list.
|
c.
Click Display to show the contents of the Employee table.
|
Note: This test calls the QueryTable servlet with the parameters tableName=EMPLOYEE and auth=Application. The servlet uses the jdbc/sample_application_managed authentication alias to connect to the database and display the table data.
|
d.
Scroll down and click Home to return to the index page.
|
e.
Repeat process for other tables in list if you like.
|
To test the EJB, do the following:
|
a.
Select an employee number from the Employee Number list.
|
b.
Click Lookup to display the employee info from the database using an EJB Container Managed Persistence entity bean.
|
Note: This test calls the Employee_Lookup servlet with the parameter empID=xxxxxx (xxxxxx = employee ID number). The servlet then obtains the employee information from the database via a EJB Entity Bean. Since the EJB bean is a Container Managed Persistence bean, the container handles all access to database including authentication.
|
c.
Scroll down and click Home to return to the index page.
|
d.
Repeat the process for other employees if you like.
|
|