Solved

How do I create Web listener in Oracle 9i database (not in oracle 9iAS)?

Posted on 2004-04-28
1
469 Views
Last Modified: 2012-08-14
I am the beginer to the PSP(PLSQL Server Pages),I created a sample psp procedure "first"

<% page LANGUAGE="PL/SQL" %>
<% plsql PROCEDURE="first" %>
<HTML>
<HEAD><TITLE>This is a PSP Page </TITLE></HEAD>
<BODY>

This is a list of employees:<BR>
<% FOR emp IN (SELECT * FROM emp) %>
Employee ID = <%= emp.empno %>
Employee NAME = <%= emp.ename %> <BR>
<% END LOOP; %>
</BODY>
</HTML>

I have loaded this procedure into Database using loadpsp.
To access from the Internet explorer ,
I have to create PL/SQL Gateway through a Web Listener.
How do I create Web listener in Oracle 9i database (not in oracle 9iAS)?
0
Comment
Question by:rehman123
1 Comment
 
LVL 47

Accepted Solution

by:
schwertner earned 250 total points
Comment Utility
Appache is installed on your computer as standart component of Oracle 9i installatio





What is MOD_PLSQL and what can one use it for?
MOD_PLSQL is an Apache module extention written by Oracle Corporation to render dynamic web pages from standard Oracle PL/SQL code. MOD_PLSQL was formerly called the Oracle PL/SQL Cartridge and OWA (Oracle Web Agent).
For more information about the Apache server, see the Oracle HTTP Server FAQ. More information about PL/SQL can be obtained from the PL/SQL FAQ.

+-CLIENT-+                +----------------S E R V E R--------------+
|        |                |                                         |
|   Web  | <--Internet--> | Oracle HTTP <-> mod_plsql <->  Oracle   |
| Browser|      HTTP      |   Server                      Database  |
|        |                |                                         |
+--------+                +-----------------------------------------+
·  Back to top of file
 
How does one start and stop MOD_PLSQL?
By default MOD_PLSQL is started when the Oracle HTTP Server is started.
·  Back to top of file
 
How does one configure MOD_PLSQL?
Start a Web Browser like Netscape Navigator and Internet Explorer and navigate to the MOD_PLSQL Gateway Configuration Menu (http://your.host.name:7777 and click on "mod_plsql"). Click on "Gateway Database Access Descriptor Settings". Select one of the options to add a new DAD (Database Access Descriptor). Enter at least the following fields:
·      Database Access Descriptor (DAD) Name
·      Schema Name
·      Oracle User Name
·      Oracle Password
·      Oracle Connect String (if not the local DB)
Click on "Apply" to make your changes permanent.
Configuration parameters and log files are stored in the $ORACLE_HOME/Apache/modplsql subdirectory.
·  Back to top of file
 
How does one program using MOD_PLSQL?
Standard Oracle PL/SQL programs can be extended to include MOD_PLSQL The Oracle Web Agent extends the Common Gateway Interface (CGI) to Oracle PL/SQL stored procedures. Programming is done in PL/SQL using the following set of packaged procedures:
o      HTP - Hypertext Procedures
o      HTF - Hypertext Functions
o      OWA_UTIL - Oracle Web Agent Utilities
o      OWA_COOKIE - Send end retrieve Web Browser Cookies
o      Etc.
Example PL/SQL procedure:
      CREATE OR REPLACE PROCEDURE HelloWorld AS
      BEGIN
            htp.htitle('My first dynamic Web page');
            htp.print('Hello world');
            htp.line;
      END HelloWorld;
      /
To run this example you would typically provide an URL like this to your Web Browser:
       http://your.host.name/pls/<DAD_NAME>/HelloWorld
·  Back to top of file
 
How does one use HTTP COOKIEs?
Cookies allow any site to store information on a WEB Browser's hard disk (cookie.txt file). This information is sent back to the originating site whenever you access it again.
Look at this code example:
      owa_util.mime_header ('text/html', FALSE);
      owa_cookie.send (cuid, xsession_id, sysdate+1);
      owa_util.http_header_close;
·  Back to top of file
 
Can a Web page be refreshed/reloaded after a given interval?
Yes, use the OWA_UTIL.REDIRECT_URL function. Alternitavely, look at the code example below:
      <HTML>
      <HEAD>
      <META HTTP-EQUIV="REFRESH" CONTENT="3; URL=any_valid_url">
      <TITLE>Stay tuned!  3 Seconds until relocation</TITLE>
      ...
      </HTML>
·  Back to top of file
 
Where can one get more info about MOD_PLSQL?
·      Download mod_owa - Open source Apache PL/SQL Gateway Module
·      The Unofficial Oracle Web/Application Server Site
·      OWSKiller - replace OWS with Java servlets for free
·      MOWI - WWW to Oracle Interface
·      SWOOP - WWW/ORACLE Connectivity Software
·      Oracle XML integration
·      WebAlchemy - tool for translating HTML to PL/SQL

Example:
After you create DAD as explained above named NIKI try:


Log using SQL*Plus in the schema for wich you have created the DAD NIKI:

CREATE OR REPLACE PROCEDURE L43 AS
      BEGIN
            htp.print('<HTML><HEAD><TITLE>Listing 4-3</TITLE></HEAD>');
            htp.print('<BODY>');
                htp.print('<FORM NAME="F1" ACTION="http://ms.com/asp/prc.asp" METHOD="GET">');
                htp.print('<TEXTAREA NAME="TA" COLS="40" ROWS="4" WRAP=soft">');
                htp.print('This text is inside TEXTAREA 1. Note how lines of code are  ');
                htp.print('automatically wrapped and how line breaks in the code cause breaks.');
                htp.print('</TEXTAREA>');
                htp.print('<BR>');
                htp.print('<TEXTAREA NAME="TA2" COLS="40" ROWS="4" WRAP=soft"> ');
                htp.print('This text is inside TEXTAREA 2. Note how lines of code are');
                htp.print('not automatically wrapped and how line breaks in the code cause breaks.');
                htp.print('</TEXTAREA>');
                htp.print('<BR><INPUT TYPE="submit">');
                htp.print('</FORM>');
                htp.print('</BODY>');
                htp.print('</HTML>');
      END L43;
/


http://<your computer name>:7778/pls/niki/L43
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Join & Write a Comment

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
Using SQL Scripts we can save all the SQL queries as files that we use very frequently on our database later point of time. This is one of the feature present under SQL Workshop in Oracle Application Express.
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now