Unit 12.1. What PL/SQL Server Pages Are

What PSPs Are

PL/SQL Server Pages (PSPs) are Oracle’s PL/SQL scripting (programming/developing) solution for server-side Web application development. They enable PL/SQL programmers to develop Web pages with dynamic content by embedding PL/SQL scripts in HTML pages. After these scripts are loaded into the database, they can then be executed when Web clients request the pages these scripts paint.

PSP pages are HTML pages with embedded PL/SQL scripts that are distinguished from the HTML content. This appearance of separation of application logic (embedded PL/SQL scripts) from the presentation logic (HTML) makes the development and maintenance of PSP pages easy. PSPs can be thought of as the reverse of PL/SQL Web Toolkit pages. A PL/SQL Web Toolkit page is a PL/SQL procedure with HTML code embedded in it. A PSP is an HTML page with PL/SQL code embedded in it.

PSPs are:

  • Available in only version 8.1.6 and above of the Oracle database.

  • Only used for server-side scripting and, therefore, all load balancing must be performed by the database server.

  • Deployed directly into and served from an Oracle 9i (or 8i, v8.1.6 and above) database.

  • A way in which Oracle combines third-party Web page design with its current data manipulation and retrieval techniques.

For developers already familiar with PL/SQL, quite possibly the quickest way to create professional-looking Web pages that are integrated with the database is to add PL/SQL to existing HTML pages. You can easily create dynamic Web pages simply by adding some special PL/SQL Server Page (PSP) tags to static HTML pages. This marked-up PSP file is then loaded into the Oracle 9i database so that when a user invokes this page from a browser, the dynamic content for that page is served up and made available from the database.

Another advantage to using PSPs is that they fit well within the lifecycle of a project. A design team can perfect an HTML prototype design, and then hand it off to a programmer to implement. Using the HTML prototype, the programmer can swap out dummy data for actual PL/SQL database calls.

Other Server Technologies/Scripting Solutions

It is natural to wonder whether PL/SQL Server Pages follow the same standards as that of other server page technologies. Essentially all server page technologies start out looking like standard HTML and employ a standard scriptlet tag to include a programming or scripting language that generates the dynamic content. OAS employs a server page technology called LiveHTML that uses Perl as its scripting language. However, LiveHTML has been replaced in Oracle 9iAS by PHP. PHP (or Hypertext Preprocessor) is an open-source server page technology that uses a scripting language similar to Perl. However, Oracle does not, at the time of this writing, officially support PHP with Oracle 9iAS.

Since any kind of tags can be passed unchanged to the browser through a PL/SQL Server Page, you can embed JavaScript or other client-side script code in a PL/SQL server page the same way you embed JavaScript in an HTML page. You cannot, however, mix PL/SQL Server Pages with other server-side script features, such as server-side include files (include files are outlined more fully in the next unit, “Developing PSPs”). It doesn’t matter, though; for, in many cases, you can get the same results by using the corresponding PSP features.

Microsoft’s server page technology is Active Server Pages (ASP), which is supported by Microsoft’s IIS Web Server. ASP uses Visual Basic as its scripting language. PSP uses syntax similar to that of ASP, although the syntax is not identical and you must typically translate from VBScript or JScript to PL/SQL. The best candidates for scripting language migration are pages that use the Active Data Object (ADO) interface to perform database operations. This type of interface is typical in many applications created with Visual Basic. And last, but not least, Java Server Pages (JSP) uses Java as its scripting language. PSP uses the same script tag syntax as JSP, making it easy to switch back and forth.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.142.197.95