Page 560
Logger | This component automatically collects statistics regarding HTTP requests. You can also configure the Logger to trace the execution of other WebServer components. |
Log Analyzer | With this component, you can view HTTP-request log entries and run various reports that summarize the execution of Oracle WebServer. |
Migration | In addition to migrating from WebServer 2.0 to WebServer 3.0, this component enables you to configure the Netscape Server for use with the Oracle Web Broker. |
DAD Administration | This component enables you to create and modify Database Access Descriptors. |
Web Request Broker | This is a link to the Web Request Broker Administration page. |
Default Configuration | By selecting this link, you can install a set of default users and PL/SQL packages in an Oracle database. |
Support | This link enables you to fill out an Oracle Support form. |
Cartridge Administration | With this link, you can select a cartridge type such as PL/SQL, Java, or Perl. Once you've selected a cartridge type, you can view, create, reconfigure, or delete a Web Agent for that cartridge type. |
The following sections present a closer look at some of these links.
Figure 21.4. Page 561
Choices for configur-
ing the Web Applica-
tion Server.
Before you can create a new Web Agent based on a particular cartridge type (such as PL/SQL), you probably will want to create a new DAD. To do this, select the DAD Administration link from the Web Application Server Administration page. From the DAD Administration page, you will see another link titled Create New DAD. Select this link. Another page, titled Database Access Descriptor Creation will appear (see Figure 21.5). On this page, there are several fields for which you will enter information:
DAD Name | The name of the new Database Access Descriptor (flugle). |
Database user | The name of the Oracle account that the new DAD should use when connecting to the Oracle database (flugle). |
Database User Password | The password for the database user (flugle). |
Confirm Password | A confirmation of the database user's password (flugle). |
ORACLE_HOME | The server directory that is defined as ORACLE_HOME for the ORACLE_SID (the next parameter in the form). Ask your DBA for the correct value for ORACLE_HOME. |
ORACLE_SID | The name of the Oracle database to which the new DAD should connect. This assumes that the Oracle database resides on the same machine as the Oracle WebServer. If this is not the case, you will need to enter a value in the field titled SQL*Net V2 Service. |
Figure 21.5. Page 562
Creating a new
Database Access
Descriptor.
When you have entered values for all of the required fields, click the Submit New DAD button at the bottom of the page.
You'll want to reconfigure the Web Request Broker for at least one reason: to specify a virtual directory for your application.
Virtual Directory | /flugle/owa |
Application | PLSQL |
Physical Path | %ORACLE_HOME%/bin |
Figure 21.6.
Specifying a virtual
directory for an
application for the
Web Request Broker.
For an actual application, you may want to modify other WRB parameters such as Protecting Applications.
Page 563
You can select the Cartridge Administration link from the Web Application Server Administration page. As you can see in Figure 21.7, several cartridge types will be displayed, including:
Figure 21.7.
Selecting a cartridge
type.
Select the PLSQL cartridge type. Another page, titled PL/SQL Agent Administration, will be displayed (see Figure 21.8).
On this page, you can select the link named Create New PL/SQL Agent. In the next page that appearsPL/SQL Agent Creationenter these values in the fields:
Name of PL/SQL Agent | flugle |
Name of DAD to be used | flugle |
Scroll down and click the button labeled Submit New PL/SQL Agent. Oracle WebServer should create the new PL/SQL Agent.
Page 564
Figure 21.8.
PL/SQL Agent
Adminstration.
Included with Oracle WebServer are several PL/SQL packages that are installed by default. One package, htp, contains a large number of procedures that generate HTML tags. Another package, htf, includes a large number of functions that can be used as arguments to many of the procedures in the htp package.
As an example, let's look at a very elementary example of how a dynamic Web page is generated from a stored procedure. The following code is a stored procedure named StudentList that displays a subset of student information, one student per line, in a Web browser.
PROCEDURE StudentList IS cursor GetStudents is select Student_ID, Last_Name, First_Name from Student order by Student_ID;
Page 565
S_ID Student.Student_ID%type; LName Student.Last_Name%type; FName Student.First_Name%type; begin open GetStudents; htp.HTMLOpen; htp.BodyOpen; loop fetch GetStudents into S_ID, LName, FName; exit when GetStudents%NOTFOUND; htp.print (`Student ID: ` || S_ID); htp.print (`Last Name: ` || LName); htp.print (`First Name: ` || FName); htp.para; end loop; htp.BodyClose; htp.HTMLClose; END;
ANALYSIS
A cursor, named GetStudents, is declared which selects the student ID, last name, and first name from the Student table. Three other variables are declaredS_ID, LName, and FNamewhich will contain the values from the cursor's columns as each row is fetched.
At the beginning of the procedure, the cursor is opened. Two procedures are invoked in the htp package: HTMLOpen and BodyOpen. These packages generate the <HTML> and <BODY> tags, respectively.
In the cursor loop, each row is fetched from the cursor. A procedure, named htp.print, is used to print each row's value for student ID, last name, and first name. A call to htp.para is used to generate the <P> tag, signifying a paragraph. Finally, when the loop is closed, htp.BodyClose and htp.HTMLClose are called, generating </BODY> and </HTML> tags,respectively.
Figure 21.9 displays the output of the StudentList stored procedure.